Undo.RecordObject(s) reverts Editor members

Hi all,

I have a custom editor (with heavy use of OnSceneGUI), and every time I perform an undo (just regular Ctrl-Z) it reverts all the members that are internal to my editor (selections, etc.).

Anyone know if there is a way around this? I’ve tried pushing my editor along with the objects I push for my undos with no luck.

Thanks,

To anyone interested, I fixed this by making a ScriptableObject that held anything I want to survive an undo which I lazily instantiate and link to statically, the hide flags are set to HideAndDontSave.

It’s still strange that the editor resets a whole bunch of members after an Undo.