public void LoadLevel(int levelNumber, LoadSceneMode sceneMode, OnFadeOutDone onFadeOutDone = null) { if (isLoading) { return; } this.onFadeOutDone = onFadeOutDone; StartCoroutine(Loading(levelNumber, sceneMode)); }
IEnumerator FadeOut() { OnFadeOutStart?.Invoke(eventData); image.enabled = true; image.color = Color.black; timer = time; float process; while (timer >= 0) { timer -= Time.deltaTime; process = timer / time; image.color = new Color(0, 0, 0, process); yield return(0); } image.enabled = false; timer = -0f; OnFadeOutDone?.Invoke(eventData); }