//Enumerator to fade out the home screen once a mode is selected IEnumerator FadeOutHome() { ReturnBtn.BtnDisable(); while (PlayUICanvas.alpha > 0) { ConsistentUICanvas.alpha = BGCanvas.alpha = PlayUICanvas.alpha -= Time.deltaTime * 1f; yield return(null); } SceneManager.LoadScene("WorldSelect"); }
//Play function private void Play() { //inform the return btn which UI we are on ReturnBtn.ChangeState("Play"); //disable return to prevent glitchyui ReturnBtn.BtnDisable(); //fade in mode select screen StartCoroutine(PlayFadeEnum()); }