public void NewActionCustomPreState(TaeUndoRestorableGraphState customPreState, Action doAction, Action undoAction) { RedoStack.Clear(); var newAction = new TaeUndoableAction(MainScreen.Graph, doAction, undoAction, customPreState); newAction.PerformDo(); UndoStack.Push(newAction); }
public void PerformDo() { if (!IsCustomPreState) { StateOnUndo = new TaeUndoRestorableGraphState(Graph, ItemsToCapture); } DoAction?.Invoke(); StateOnRedo?.RestoreState(); }
public TaeUndoableAction(TaeEditAnimEventGraph graph, Action doAction, Action undoAction, TaeUndoRestorableGraphState customPreState) { Graph = graph; ItemsToCapture = null; StateOnUndo = customPreState; IsCustomPreState = true; ItemsToCapture = new List <ITaeClonable>(); DoAction = doAction; UndoAction = undoAction; }
public void PerformUndo() { StateOnRedo = new TaeUndoRestorableGraphState(Graph, ItemsToCapture); UndoAction?.Invoke(); StateOnUndo?.RestoreState(); }