Class AssetEditorUtility
A utility class for executing operations related to Unity assets in the editor.
Namespace: Unity.AnimeToolbox.Editor
Syntax
public static class AssetEditorUtility
Methods
DeleteAssetsOrFiles(String, String)
Delete assets/files in a given path with specified file patterns. This can delete files both inside and outside Unity project folder.
Declaration
public static void DeleteAssetsOrFiles(string path, string searchPattern)
Parameters
| Type | Name | Description |
|---|---|---|
| String | path | The path which contain the assets to be deleted. |
| String | searchPattern | The pattern of the files. Ex: "*.prefab" |
OverwriteAsset(Object, String)
Creates an asset in a given path from an Object. This will overwrite the existing asset if it exists.
Declaration
public static void OverwriteAsset(Object asset, string path)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | asset | The object to be created as an asset. |
| String | path | The path of the asset, relative to the Unity project folder. |
PingAssetByPath(String)
Pings (highlights) an asset by its path in the Project window. The path can be absolute, or relative to the Unity project folder.
Declaration
public static bool PingAssetByPath(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| String | path | The asset path. |
Returns
| Type | Description |
|---|---|
| Boolean | True if the asset is found. False otherwise. |