AssetDatabase

class in UnityEditor

Switch to Manual

Description

Интерфейс для доступа к ассетам и выполнения операций в ассетах.

Static Functions

AddObjectToAssetДобавляет objectToAdd к существующему ассету в path.
AssetPathToGUIDGet the GUID for the asset at path.
ClearLabelsУдаляет все метки, привязанные к ассету.
ContainsЯвляется ли объект ассетом?
CopyAssetДублирует ассет в path и сохраняет его в newPath.
CreateAssetСоздаёт новый ресурс по указанному пути.
CreateFolderСоздать новую папку.
DeleteAssetУдаляет ресурс по указанному пути.
ExportPackageЭкспортирует ассеты, определяемые по assetPathNames к файлу unitypackage в fileName.
ExtractAssetCreates an external Asset from an object (such as a Material) by extracting it from within an imported asset (such as an FBX file).
FindAssetsSearch the asset database using the search filter string.
ForceReserializeAssetsForcibly load and re-serialize the given assets, flushing any outstanding data changes to disk.
GenerateUniqueAssetPathСоздает новый уникальный путь для ассета.
GetAllAssetBundleNamesReturn all the AssetBundle names in the asset database.
GetAssetBundleDependenciesGiven an assetBundleName, returns the list of AssetBundles that it depends on.
GetAssetDependencyHashВозвращает массив всех объектов ассета в assetPath.
GetAssetOrScenePathВозвращает имя пути относительно папки проекта, где хранится ассет.
GetAssetPathВозвращает имя пути относительно папки проекта, где хранится ассет.
GetAssetPathFromTextMetaFilePathПолучает путь к текстовому файлу .meta, связанному с ассетом.
GetAssetPathsFromAssetBundleGet the paths of the assets which have been marked with the given assetBundle name.
GetAssetPathsFromAssetBundleAndAssetNameGet the Asset paths for all Assets tagged with assetBundleName and named assetName.
GetCachedIconВосстанавливает иконку для ассета на данном пути ассета.
GetCurrentCacheServerIpGets the IP address of the Cache Server currently in use by the Editor.
GetDependenciesДанный массив pathNames возвращает список всех ассетов, от которых зависят ассеты.
GetImplicitAssetBundleNameReturns the name of the AssetBundle that a given asset belongs to.
GetImplicitAssetBundleVariantNameReturns the name of the AssetBundle Variant that a given asset belongs to.
GetLabelsВозвращает все метки, прикрепленные к данному ассету.
GetMainAssetTypeAtPathReturns the type of the main asset object at assetPath.
GetSubFoldersGiven a path to a directory in the Assets folder, relative to the project folder, this method will return an array of all its subdirectories.
GetTextMetaFilePathFromAssetPathПолучает путь к текстовому файлу .meta, связанному с ассетом.
GetUnusedAssetBundleNamesReturn all the unused assetBundle names in the asset database.
GUIDToAssetPathПереведите GUID к его текущему пути ассета.
ImportAssetИмпорт ассета по пути.
ImportPackageИмпортирует пакет по packagePath в текущий проект.
IsForeignAssetDetermines whether the Asset is a foreign Asset.
IsMainAssetЯвляется ли ассет главным ассетом в окне проекта?
IsMainAssetAtPathLoadedReturns true if the main asset object at assetPath is loaded in memory.
IsMetaFileOpenForEditQuery whether an asset's metadata (.meta) file is open for edit in version control.
IsNativeAssetDetermines whether the Asset is a native Asset.
IsOpenForEditQuery whether an asset file is open for edit in version control.
IsSubAssetЯвляется ли форма ассета частью другого ассета?
IsValidFolderGiven a path to a folder, returns true if it exists, false otherwise.
LoadAllAssetRepresentationsAtPathReturns all sub Assets at assetPath.
LoadAllAssetsAtPathReturns an array of all Assets at assetPath.
LoadAssetAtPathВозвращает первый объект ассета типа type по данному пути assetPath.
LoadMainAssetAtPathВозвращает объект главного ассета в assetPath.
MoveAssetMove an asset file (or folder) from one folder to another.
MoveAssetToTrashПеремещает ассет по пути в корзину.
OpenAssetОткрывает ассет с соответствующим приложением.
RefreshИмпорт любых измененных ассетов.
ReleaseCachedFileHandlesCalling this function will release file handles internally cached by Unity. This allows modifying asset or meta files safely thus avoiding potential file sharing IO errors.
RemoveAssetBundleNameRemove the assetBundle name from the asset database. The forceRemove flag is used to indicate if you want to remove it even it's in use.
RemoveObjectFromAssetRemoves object from its asset (See Also: AssetDatabase.AddObjectToAsset).
RemoveUnusedAssetBundleNamesRemove all the unused assetBundle names in the asset database.
RenameAssetПереименуйте файл ассета.
SaveAssetsЗаписывает все несохраненные изменения на диск.
SetLabelsЗаменяет список меток на ассет.
SetMainObjectSpecifies which object in the asset file should become the main object after the next import.
StartAssetEditingНачните импорт ассета. Это позволит вам сгруппировать несколько импортов ассетов в один большой импорт.
StopAssetEditingОстановите импорт ассета. Это позволит вам сгруппировать несколько импортов ассетов в один большой импорт.
TryGetGUIDAndLocalFileIdentifier Warning Use the overload with a long localId parameter. Using the overload with an integer localId parameter can cause an integer overflow in localId. This can happen when the object passed to the API is part of a Prefab.Get the GUID and local file id from an object instance id.
ValidateMoveAssetПроверяет, если файл ассета может быть перемещен из одной папки в другую. (Фактически без перемещения файла).
WriteImportSettingsIfDirtyЗаписывает настройки импорта на диск.

Events

importPackageCancelledCallback raised whenever a package import is cancelled by the user.
importPackageCompletedCallback raised whenever a package import successfully completes.
importPackageFailedCallback raised whenever a package import failed.
importPackageStartedCallback raised whenever a package import starts.

Delegates

ImportPackageCallbackDelegate to be called from AssetDatabase.ImportPackage callbacks. packageName is the name of the package that raised the callback.
ImportPackageFailedCallbackDelegate to be called from AssetDatabase.ImportPackage callbacks. packageName is the name of the package that raised the callback. errorMessage is the reason for the failure.