예제 #1
0
 /// <summary>
 /// Swaps turn to the next player (color) and sendt text info
 /// </summary>
 public void SwapTurn()
 {
     if (turn == ChessEnum.Color.White)
     {
         turn = ChessEnum.Color.Black;
         whiteTurnImg.SetActive(false);
         blackTurnImg.SetActive(true);
     }
     else
     {
         turn = ChessEnum.Color.White;
         whiteTurnImg.SetActive(true);
         blackTurnImg.SetActive(false);
     }
     GameObject.FindGameObjectWithTag("Timers").GetComponent <TimerCanvas>().turn = turn; //timer turn swap
 }
예제 #2
0
 /// <summary>
 /// Start clock ad start of a game
 /// </summary>
 private void Start()
 {
     // Starts the timer automatically
     timerIsRunning = true;
     turn           = ChessEnum.Color.White;
 }