Beispiel #1
0
        public void GameOver()
        {
            isGameOver = true;
            FrozeAllEnemies();
            player.Disable();
            joystickGameObject.gameObject.SetActive(false);
            capacitiesGameObject.SetActive(false);
            SpriteRenderer playerSprite = player.GetComponent <SpriteRenderer>();

            AudioManager.Instance.Mute(true, AudioManager.CHANNEL.SECOND_MUSIC);
            CoroutineManager.Instance.Wait(0.2f, () =>
            {
                AudioManager.Instance.PlayAudioClip(AudioManager.SFX.GameOver);
                playerSprite.sprite = playerDeath[0];
                CoroutineManager.Instance.Wait(0.5f, () => {
                    playerSprite.sprite = playerDeath[1];
                    CoroutineManager.Instance.Wait(0.5f, () => {
                        gameOverGameObject.SetFirstPlayerImage(player.playerSprites[player.currentSprite]);
                        gameOverGameObject.gameObject.SetActive(true);
                        gameOverGameObject.PlayDeathAnimation();
                        cinematicGameObject.SetActive(false);
                    });
                });
            });
        }