Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        //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);
            }
        }
Ejemplo n.º 3
0
 public void pressUndo()
 {
     c.undo();
 }
Ejemplo n.º 4
0
 public void undoButtonWasPushed()
 {
     undoCommand.undo();
 }
Ejemplo n.º 5
0
 public void UndoButtonWasPressed()
 {
     undoCommand.undo();
 }