Undo.DestroyObjectImmediate - accessing objects in the undo buffer
I'm making an editor tool for spawning prefabs into a scene. The tool allows for deletion of prefabs as well and I want it to work with the undo-system.
My problem is that I am able to record destroyed objects using Undo.DestroyObjectImmediate(gameObject), but when the deletion is undone the prefabs will be turned off automatically. I would also like to store the objects in my own datastructure once they are spawned back in to the scene using undo.
Is it possible to do using the undo system?
Any help welcome
Your answer
Follow this Question
Related Questions
How to Undo a bool on an EditorWindow 1 Answer
Unity5-serializedObject.FindProperty("listname") for ReorderableList doesn't work... 2 Answers
Applying values from an animationClip to bones of a skinnedMesh via code? 0 Answers
How is my waypoint line going back to the gameobject it is stored in and not to the waypoint 0 0 Answers