public void GameOverDied()
 {
     AudioEvent.SendAudioEvent(AudioEvent.AudioEventType.Died, audioEvents, gameObject);
     GameEnd();
     DiedText.SetActive(true);
     _fadeout.StartFade();
     StartCoroutine(WaitForRestart());
 }
Beispiel #2
0
 // Update is called once per frame
 void Update()
 {
     if (startFadeIn == true)
     {
         fadeIn.StartFade();
         startFadeIn = false;
     }
     if (startFadeOut == true)
     {
         fadeOut.StartFade();
         startFadeOut = false;
     }
 }
Beispiel #3
0
    public void FadeOutBGM(float time, System.Action callback)
    {
        if (!this.bgmAudioSource.isPlaying)
        {
            return;
        }

        FadeOut fadeout = this.obj.GetComponent <FadeOut>() ?? this.obj.AddComponent <FadeOut>();

        fadeout.Source   = this.bgmAudioSource;
        fadeout.FadeTime = time;
        fadeout.Callback = callback;
        fadeout.StartFade();
    }