// loops through the game private IEnumerator GameLoop() { // starts the start round coroutine yield return(StartCoroutine(RoundStarting())); // starts the playing round coroutine yield return(StartCoroutine(RoundPlaying())); // starts the end round coroutine yield return(StartCoroutine(RoundEnding())); // checks if there is a game winner if (m_bPlayerWon) { // sets the game up for the end DisableControls(); foreach (var player in m_players) { if (!player.activeSelf) { continue; } player.GetComponent <PlayerController>().m_bIsOut = true; player.GetComponent <PlayerController>().m_konamiCamera.gameObject.SetActive(false); } m_canvas.GetComponent <UI>().FadeText(); m_canvas.GetComponent <UI>().DisableUI(); m_gameOverCanvas.PlayAnimation(); m_gameOverCanvas.m_winText.text = m_canvas.GetComponent <UI>().m_winText.text; m_gameOverCanvas.m_winText.color = new Color(m_canvas.GetComponent <UI>().m_winText.color.r, m_canvas.GetComponent <UI>().m_winText.color.g, m_canvas.GetComponent <UI>().m_winText.color.b, 0.0f); } else { // starts the game loop coroutine StartCoroutine(GameLoop()); } }