Beispiel #1
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         if (moveIndex < gameMoves.Length)
         {
             board.MakeMove(gameMoves[moveIndex]);
             boardUI.OnMoveMade(board, gameMoves[moveIndex]);
             moveIndex++;
         }
     }
 }
Beispiel #2
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.U))
     {
         if (moves.Count > 0)
         {
             var move = moves.Pop();
             board.UnmakeMove(move);
             if (moves.Count > 0)
             {
                 boardUI.OnMoveMade(board, moves.Peek());
             }
             else
             {
                 boardUI.UpdatePosition(board);
                 boardUI.ResetSquareColours(false);
             }
         }
     }
     DrawBookMoves();
     player.Update();
 }