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); }
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(); }
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>(); }