Select your preferred scripting language. All code snippets will be displayed in this language.
class in UnityEditor
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
CloseAn Interface for accessing assets and performing operations on assets.
AddObjectToAsset | Adds objectToAdd to an existing asset at path. |
AssetPathToGUID | Get the GUID for the asset at path. |
ClearLabels | Removes all labels attached to an asset. |
Contains | Is object an asset? |
CopyAsset | Duplicates the asset at path and stores it at newPath. |
CreateAsset | Creates a new asset at path. |
CreateFolder | Create a new folder. |
DeleteAsset | Deletes the asset file at path. |
ExportPackage | Exports the assets identified by assetPathNames to a unitypackage file in fileName. |
FindAssets | Search the asset database using a search filter string. |
GenerateUniqueAssetPath | Creates a new unique path for an asset. |
GetAllAssetBundleNames | Return all the AssetBundle names in the asset database. |
GetAssetDependencyHash | Returns the hash of all the dependencies of an asset. |
GetAssetOrScenePath | Returns the path name relative to the project folder where the asset is stored. |
GetAssetPath | Returns the path name relative to the project folder where the asset is stored. |
GetAssetPathFromTextMetaFilePath | Gets the path to the asset file associated with a text .meta file. |
GetAssetPathsFromAssetBundle | Get the paths of the assets which have been marked with the given assetBundle name. |
GetAssetPathsFromAssetBundleAndAssetName | Get the asset paths from the given assetBundle name and asset name. |
GetCachedIcon | Retrieves an icon for the asset at the given asset path. |
GetDependencies | Given a pathName, returns the list of all assets that it depends on. |
GetLabels | Returns all labels attached to a given asset. |
GetSubFolders | Given an absolute path to a directory, this method will return an array of all it's subdirectories. |
GetTextMetaFilePathFromAssetPath | Gets the path to the text .meta file associated with an asset. |
GetUnusedAssetBundleNames | Return all the unused assetBundle names in the asset database. |
GUIDToAssetPath | Translate a GUID to its current asset path. |
ImportAsset | Import asset at path. |
ImportPackage | Imports package at packagePath into the current project. |
IsForeignAsset | Is asset a foreign asset? |
IsMainAsset | Is asset a main asset in the project window? |
IsNativeAsset | Is asset a native asset? |
IsOpenForEdit | Use IsOpenForEdit to determine if the asset is open for edit by the version control. |
IsSubAsset | Does the asset form part of another asset? |
IsValidFolder | Given an absolute path to a folder, returns true if it exists, false otherwise. |
LoadAllAssetRepresentationsAtPath | Returns all asset representations at assetPath. |
LoadAllAssetsAtPath | Returns an array of all asset objects at assetPath. |
LoadAssetAtPath | Returns the first asset object of type type at given path assetPath. |
LoadMainAssetAtPath | Returns the main asset object at assetPath. |
MoveAsset | Move an asset file from one folder to another. |
MoveAssetToTrash | Moves the asset at path to the trash. |
OpenAsset | Opens the asset with associated application. |
Refresh | Import any changed assets. |
RemoveAssetBundleName | Remove 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. |
RemoveUnusedAssetBundleNames | Remove all the unused assetBundle names in the asset database. |
RenameAsset | Rename an asset file. |
SaveAssets | Writes all unsaved asset changes to disk. |
SetLabels | Replaces that list of labels on an asset. |
StartAssetEditing | Begin Asset importing. This lets you group several asset imports together into one larger import. |
StopAssetEditing | Stop Asset importing. This lets you group several asset imports together into one larger import. |
ValidateMoveAsset | Checks if an asset file can be moved from one folder to another. (Without actually moving the file). |
WriteImportSettingsIfDirty | Writes the import settings to disk. |