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); }
public static void AudioFadeOutEnd() { OnFadeOutEnd?.Invoke(); }