private IEnumerator FadeOutCoroutine() { // start fading yield return(StartCoroutine(FadeInFadeOut.FadeCanvas(canvasGroup, 1f, 0f, fadeOutRate))); gameObject.SetActive(false); }