The editor should have its own undo structure, so it does not interfere with Unity's undo.
Ideally, control+u would be the default undo action trigger. Unsure if it is possible to prevent Unity from also using control+u after the BonsaiEditor uses it.
I think a persistent data structure could be used as the underlying mechanism for undo. This will store state for every tree change. Undo/Redo will simply be moving up or down a list which stores copies of the persistent data structure.
The editor should have its own undo structure, so it does not interfere with Unity's undo.
Ideally,
control+u
would be the default undo action trigger. Unsure if it is possible to prevent Unity from also usingcontrol+u
after the BonsaiEditor uses it.I think a persistent data structure could be used as the underlying mechanism for undo. This will store state for every tree change. Undo/Redo will simply be moving up or down a list which stores copies of the persistent data structure.