- Home /
EventType.ValidateCommand includes Undo?
Here is the full documentation for EventType.ValidateCommand:
Validates a special command (e.g. copy & paste). "Copy", "Cut", "Paste", "Delete", "FrameSelected", "Duplicate", "SelectAll" and so on.
Does "and so on" include undo? I ask because all sample code I've found uses it to check for Undo (including an answer here: http://answers.unity3d.com/questions/33065/repaint-on-undo.html
However, in my own Editor code, the following does not catch an Undo event:
if ( Event.current.type == EventType.ValidateCommand){
Debug.Log("Event.current.type = " + Event.current.type);
}
But this does:
if ( Event.current.commandName == "UndoRedoPerformed"){
Debug.Log("Event.current.commandName = " + Event.current.commandName);
}
I can work with it using the 2nd method, but I'm worried why it isn't working, as there's zero documentation to explain.
Thanks
Comment
Your answer
Follow this Question
Related Questions
Hooking Undo / RegisterUndo 0 Answers
How to support undo for objects in .asset files 1 Answer
Destroying required components in editor 0 Answers