IEnumerator PlayGameRoutine() { if (m_levelGoal.levelCounter == LevelCounter.Timer) { m_levelGoal.StartCountdown(); } while (!m_isGameOver) { m_isGameOver = m_levelGoal.IsGameOver(); m_isWinner = m_levelGoal.IsWinner(); yield return(null); } }
IEnumerator PlayGameRoutine() { if (m_levelGoal.levelCounter == LevelCounter.Timer) { m_levelGoal.StartCountdown(); //it runs every level uses timer. } while (!m_isGameOver) { m_isGameOver = m_levelGoal.IsGameOver(); m_isWinner = m_levelGoal.IsWinner(); //wait one frame yield return(null); } }
// coroutine for game play IEnumerator PlayGameRoutine() { // if level is timed, start the timer if (m_levelGoal.levelCounter == LevelCounter.Timer) { m_levelGoal.StartCountdown(); } // while the end game condition is not true, we keep playing // just keep waiting one frame and checking for game conditions while (!m_isGameOver) { m_isGameOver = m_levelGoal.IsGameOver(); m_isWinner = m_levelGoal.IsWinner(); // wait one frame yield return(null); } }
IEnumerator PlayGameRoutine() { if (IsTimedLevel()) { levelGoal.StartCountdown(); } while (!isGameOver) { if (isPaused) { yield return(StartCoroutine(SettingsMenuRoutine())); } isGameOver = levelGoal.IsGameOver(); isWinner = levelGoal.IsWinner(); yield return(null); } }
IEnumerator PlayGameRoutine() { if (m_levelGoal.levelCounter == LevelCounter.Timer) { m_levelGoal.StartCountdown(); } while (!m_isGameOver) { m_isGameOver = m_levelGoal.IsGameOver(); yield return(null); } if (m_levelGoal.levelCounter == LevelCounter.Timer) { m_levelGoal.StopCountdown(); } yield return(StartCoroutine(WaitForBoardRoutine(0.5f))); m_isWinner = m_levelGoal.IsWinner(); }