Exemplo n.º 1
0
    IEnumerator PacmanDeathAnimation()
    {
        _soundManager.PauseBackgroundSource();

        yield return(new WaitForSeconds(settings.TimeToGhostsVanishOnPacmanDeath));

        _ghosts.ForEach(ghost => ghost.gameObject.SetActive(false));

        yield return(new WaitForSeconds(settings.TimeToStartAnimationOfPacmanDeath));

        _soundManager.PlayPacManDeathSound();
        _pacman.GetComponent <PacmanAnimator>().SetAnimation(PacmanAnimator.PacmanAnimation.DIE);

        yield return(new WaitForSeconds(settings.TimeToRestartSceneAfterPacmanDeath));

        LoseLife();
    }