Class AssetWatcher
Class to make it easier to perform actions when assets change (currently only can act on deletion).
Inheritance
System.Object
UnityEditor.AssetPostprocessor
AssetWatcher
Namespace: InsaneScatterbrain.Tools.Editor
Syntax
public class AssetWatcher : AssetPostprocessor
Properties
Instance
Declaration
public static AssetWatcher Instance { get; }
Property Value
Type | Description |
---|---|
AssetWatcher |
Methods
SubscribeForDeletion(String, Action<String>)
Registers given action to be performed when an asset is deleted and that asset's path contains (or exactly matches) the given path.
Declaration
public void SubscribeForDeletion(string path, Action<string> action)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path to match. |
System.Action<System.String> | action | The action. The string is the deleted assets path. |
UnsubscribeForDeletion(Action<String>)
Unregisters the delete action.
Declaration
public void UnsubscribeForDeletion(Action<string> action)
Parameters
Type | Name | Description |
---|---|---|
System.Action<System.String> | action | The delete action. |