Search Unity

Tell undo or redo when undoRedoPerformed event occurs?

Discussion in 'Immediate Mode GUI (IMGUI)' started by ChaseRLewis73003, Jul 12, 2015.

  1. ChaseRLewis73003

    ChaseRLewis73003

    Joined:
    Apr 23, 2012
    Posts:
    85
    Is there a way of telling whether undoRedoPerformed was a undo or a redo? That or get control+Z or control+Y in OnGUI()? It appears that control+Z or control+Y keydown or keyup never fire for OnGUI(), my assumption is because the event is consumed by Unity's Undo.

    I've rolled my own undo for my editor extension because there are a lot of interconnected types and it was easier to roll my own to make adjustments with an IUndoRedo interface and a couple stacks then figure out how to get it to work 'The Unity Way'.