예제 #1
0
 /// <summary>
 /// Handles all the match flow from the beginning until some player kills other factions. This can be
 /// interrupted by debug menu messages like <see cref="UIController.ForceLose"/> and <see cref="UIController.ForceWin"/>
 /// </summary>
 /// <returns></returns>
 private IEnumerator runMatch()
 {
     while (!m_matchManager.GameFinished())
     {
         yield return(MatchStep());
     }
     m_uiController?.ShowMatchResults();
 }
예제 #2
0
        /// <summary>
        /// Called when the player clicks the end game button. If the <see cref="GameMode"/>
        /// is <see cref="GameMode.Infinite"/>, it will relaunch the GameScene, and if it's
        /// <see cref="GameMode.SingleMatch"/>, it will relaunch the MenuScene.
        /// </summary>
        public void ContinueGame()
        {
            Debug.Assert(m_matchManager.GameFinished());
            switch (Singleton <AppController> .Instance.GameMode)
            {
            case GameMode.SingleMatch:
                UnityEngine.SceneManagement.SceneManager.LoadScene("MenuScene");
                break;

            case GameMode.Infinite:
                if (m_matchManager.HumanWon)
                {
                    Singleton <AppController> .Instance.CurrentInfiniteLevel++;
                    UnityEngine.SceneManagement.SceneManager.LoadScene("GameScene");
                }
                else
                {
                    Singleton <AppController> .Instance.CurrentInfiniteLevel = 0;
                    UnityEngine.SceneManagement.SceneManager.LoadScene("MenuScene");
                }
                break;
            }
        }