Пример #1
0
 IEnumerator PlayGameRoutine()
 {
     if (m_levelGoalTimed)
     {
         m_levelGoalTimed.StartCountdown(); //(m_levelGoal as LevelGoalTimed).StartCountdown();
     }
     //while the end game condition is not true, keep playing
     //keep waiting a frame and check game condition
     while (!IsGameOver)
     {
         IsGameOver = m_levelGoal.IsGameOver();
         m_isWinner = m_levelGoal.IsWinner();
         yield return(null);
     }
 }
Пример #2
0
    IEnumerator PlayGameRoutine()
    {
        // if level is timed, start the timer
        if (m_levelGoalTimed != null)
        {
            m_levelGoalTimed.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_Winner = m_levelGoal.GetWinner();

            // wait one frame
            yield return(null);
        }
    }