I’m currenty trying to find a way around using .net FileSystemWatcher as when a file delete callback is sent its too late to get anything from the object. I found out about AssetModificationProcessor and its OnWillDeleteAsset and its just what i need, but i cannot impliment it so far i have this;
[InitializeOnLoad]
public class ObjectDatabaseEditor : UnityEditor.AssetModificationProcessor {
//
public static AssetDeleteResult OnWillDeleteAsset(string AssetPath, RemoveAssetOptions rao)
{
Debug.Log("deleted - unity callback: " + AssetPath);
return AssetDeleteResult.DidNotDelete;
}
//
}
But it does not get called.