예제 #1
0
        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);
        }
예제 #2
0
            public void PerformDo()
            {
                if (!IsCustomPreState)
                {
                    StateOnUndo = new TaeUndoRestorableGraphState(Graph, ItemsToCapture);
                }

                DoAction?.Invoke();
                StateOnRedo?.RestoreState();
            }
예제 #3
0
            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;
            }
예제 #4
0
 public void PerformUndo()
 {
     StateOnRedo = new TaeUndoRestorableGraphState(Graph, ItemsToCapture);
     UndoAction?.Invoke();
     StateOnUndo?.RestoreState();
 }