luis-l / BonsaiBehaviourTree

An advanced behaviour tree solution for the Unity game engine
MIT License
417 stars 45 forks source link

Implement Undo #7

Open luis-l opened 4 years ago

luis-l commented 4 years ago

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.