Custom "undo" stack (editor extension)

Hi,

I was wondering if it is possible to create a separate undo stack in the editor for some custom functionality?

Specifically, I want to write an editor extension that takes a snapshot of an object before and after a function call and shows changed variables with new and old values. I don’t want this to interact with the editor’s built-in undo system though, I just want to be able to step forward/backward along object states.

My first thought was to use the undo system, but if anybody has any other ideas I’d love to hear them!

Thanks!

-D

I don’t think this is possible without writing this yourself. But in my opinion it is best to stick with the in editor Undo, as users of your extension will expect all their unity changes will be undone in the order they made it, and not have to go through 2 undo buttons.

It’s not actually an undo feature, I just wanted to be lazy :slight_smile:

My solution is to use reflection to create a stack of deltas for member data between function calls, easy like pie. I don’t actually want to undo/redo any changes, I just want a way for a designer to step through some custom extensions to debug things.

Why not attach a debugger?

It’s for designers/artists who need to debug some logic in the editor, like triggers not opening doors, animations not firing in scripted sequences, etc. Not meant for programmers.