Hi,
This is the situation:
I have an asset in my scene. Whenever I duplicate it, its assets (meshes, mat, etc.) are uniquified. Whenever I delete one of these assets from my scene, I need those unique assets to be deleted also. However, not immediately because I want to retain undo funcionallity.
What I made is a script that stores asset paths and as soon as the EditorApplication.isQuitting event is fired, it deleted those assets from the project. I currently have a singleton patern that creates a HideAndDontSave gameobject in the scene with the monobehaviour component. This stores the list of asset paths (string).
How do I make sure that as soon as I undo the deletion of the asset from the scene, this list is also restored so that the added path is once again removed? I tried making the class static, a monobehaviour, a ScriptableObject, nothing seems to be able to register the Undo of this list properly. Also Undo.RegisterCompleteObjectUndo does not seem to work.
Any idea’s? I’m out of any ![]()
Kind regards,
Mathijs van Nimwegen