/// <summary> /// Performs an undo operation. /// </summary> private void Undo() { // Nothing to undo? if (_actionStack.Count == 0 || _actionStackPointer < 0) { return; } if (UndoStart != null) { UndoStart(); } // Get the action pointed to by the stack pointer and undo it IUndoableAndRedoableAction actionToUndo = _actionStack[_actionStackPointer]; actionToUndo.Undo(); // Move the stack pointer backwards --_actionStackPointer; if (UndoEnd != null) { UndoEnd(); } }
/// <summary> /// Performs an undo operation. /// </summary> private void Undo() { //added by me EventSystem.current.SetSelectedGameObject(null); // // Nothing to undo? if (_actionStack.Count == 0 || _actionStackPointer < 0) { return; } if (UndoStart != null) { UndoStart(); } // Get the action pointed to by the stack pointer and undo it IUndoableAndRedoableAction actionToUndo = _actionStack[_actionStackPointer]; actionToUndo.Undo(); // Move the stack pointer backwards --_actionStackPointer; if (UndoEnd != null) { UndoEnd(); } }
/// <summary> /// Performs an undo operation. /// </summary> public void Undo() { // Nothing to undo? if (_actionStack.Count == 0 || _actionStackPointer < 0) { return; } // Get the action pointed to by the stack pointer and undo it IUndoableAndRedoableAction actionToUndo = _actionStack[_actionStackPointer]; actionToUndo.Undo(); // Move the stack pointer backwards --_actionStackPointer; }