예제 #1
0
        public void Redo()
        {
            if (redoActions.Count <= 0)
            {
                return;
            }

            NRAction action = redoActions.Last();

            Debug.Log("Redoing action:" + action.ToString());

            action.DoAction(timeline);

            actions.Add(action);
            redoActions.RemoveAt(redoActions.Count - 1);
        }
예제 #2
0
        public void Undo()
        {
            if (actions.Count <= 0)
            {
                return;
            }

            NRAction action = actions.Last();

            Debug.Log("Undoing action:" + action.ToString());

            action.UndoAction(timeline);

            redoActions.Add(action);
            actions.RemoveAt(actions.Count - 1);

            timeline.ReapplyScale();
        }
예제 #3
0
        public void AddAction(NRAction action)
        {
            action.DoAction(timeline);

            if (actions.Count <= maxSavedActions)
            {
                actions.Add(action);
            }
            else
            {
                while (maxSavedActions > actions.Count)
                {
                    actions.RemoveAt(0);
                }

                actions.Add(action);
            }

            redoActions = new List <NRAction>();
        }