Example #1
0
 public void Init()
 {
     m_isGameStarted = false;
     StatusText.SetText(Constant.STATUS_TEXT.WAIT_FOR_CHOICE);
     PlayerChooseRole.Init();
     Field.Init();
     m_player0.ClearScore();
     m_player1.ClearScore();
     buttonNextRound.SetActive(false);
     roundResult.SetActive(false);
     buttonUndoOnce.SetActive(true);
     dropdownGameMode.GetComponent <Dropdown>().interactable = true;
 }
Example #2
0
 public static void StartGame()
 {
     m_isGameStarted = true;
     dropdownGameModeStatic.GetComponent <Dropdown>().interactable = false;
     StatusText.SetText(Constant.STATUS_TEXT.CROSS_TURN);
     m_player0.SetRole(PlayerChooseRole.GetChoice());
     m_player1.SetRole(PlayerChooseRole.GetAnotherChoice());
     if (m_gameMode == GameMode.PlayerVsAI)
     {
         m_player0.SetAI(false);
         m_player1.SetAI(true);
     }
     else if (m_gameMode == GameMode.PlayerVsPlayer)
     {
         m_player0.SetAI(false);
         m_player1.SetAI(false);
     }
     else if (m_gameMode == GameMode.AIVsAI)
     {
         m_player0.SetAI(true);
         m_player1.SetAI(true);
     }
     if (m_player0.GetRole() == PlayerRole.Cross)
     {
         m_currentPlayer = m_player0;
         m_anotherPlayer = m_player1;
     }
     else
     {
         m_currentPlayer = m_player1;
         m_anotherPlayer = m_player0;
     }
     PlayerChooseRole.SetEnableChooseRoleButtons(false);
     if (m_currentPlayer.IsAI())
     {
         instance.StartCoroutine(CurrentPlayerDoTurnAfterSeconds(Constant.AI_THINKING_SECONDS));
     }
 }
Example #3
0
 public void IncreaseScore()
 {
     ++m_score;
     PlayerChooseRole.SetScore(GetRole(), GetScore());
 }