public override void run(Transform Player2, Command command) { List <Command> past = InputHandler.past; if (past.Count > 0) { Command lastCommand = past[past.Count - 1]; //move the box with this command lastCommand.undo(Player2); //Remove the command from the list past.RemoveAt(past.Count - 1); } }
//Called when we press a key public override void Execute(GameObject t, Command command) { List <Command> oldCommands = InputHandler.oldCommands; if (oldCommands.Count > 0) { Command latestCommand = oldCommands[oldCommands.Count - 1]; latestCommand.undo(t); //Remove the command from the list oldCommands.RemoveAt(oldCommands.Count - 1); } }
public void pressUndo() { c.undo(); }
public void undoButtonWasPushed() { undoCommand.undo(); }
public void UndoButtonWasPressed() { undoCommand.undo(); }