예제 #1
0
    private IEnumerator PlayerLifeLostSequence()
    {
        // It is intentional that there is no message telling the player they have lost a life.
        ChangeGameState(GameState.LifeLost);
        PlaySound(SoundList.LifeLost);

        playerLifeManager.PlayerLosesALife();
        playersBatManager.PlayerLosesLife();

        ballManager.LifeLost();
        brickManager.LifeLost();
        powerUpManager.LifeLost();
        fallingObjectsManager.LifeLost();
        CoreConnector.GameUIManager.LifeLost();

        levelTimer.StopTimer();

        yield return(new WaitForSeconds(1.0f));

        if (playerLifeManager.PlayerLives < 1)
        {
            // game over;
            CoreConnector.GameManager.PlayerLostAllLives();
            yield break;
        }

        // player still has lives left!
        StartPlay(0.5f);
    }