Exemple #1
0
    void Update()
    {
        timeInLevel += Time.deltaTime;
        playerRespawnTimer.Update(Time.deltaTime);
        levelEndDelayTimer.Update(Time.deltaTime);

        if (Input.GetButtonDown("Escape"))
        {
            player.Deactivate();
            vignette.FadeOut();
            levelEndDelayTimer.SetEventFunction(() => ReturnToMenu());
            levelEndDelayTimer.Restart();
            GameObject.FindGameObjectWithTag("Music").GetComponent <MusicSingletonScript>().FadeOut(musicFade, musicFadeTime);
        }
    }
Exemple #2
0
 private void FadeOut()
 {
     fade.FadeOut();
     lifetime.SetTargetTime(fade.fadeOutTime);
     lifetime.SetEventFunction(() => SwitchScene());
     lifetime.Restart();
 }