Beispiel #1
0
    private IEnumerator FadeOut()
    {
        float value = 1;

        OnFadeOutStart.Invoke();
        while (value > 0)
        {
            value            -= 0.05f;
            canvasGroup.alpha = value;
            yield return(new WaitForEndOfFrame());
        }
        OnFadeOutEnd.Invoke();
        FadeOutComplete();
        gameObject.SetActive(false);
    }
Beispiel #2
0
 public static void AudioFadeOutEnd()
 {
     OnFadeOutEnd?.Invoke();
 }