private IEnumerator LoadSceneCoroutine(string sceneName, BeforeUnloadDelegate beforeUnloadDelegate) { TransitionCanvas.getInstance().FadeOut(0.5f); yield return(StartCoroutine(utils.Coroutine.WaitForRealSeconds(0.5f))); beforeUnloadDelegate(); PlayerScore.Reset(); SceneManager.LoadScene(sceneName); }
public void LoadScene(string sceneName, BeforeUnloadDelegate beforeUnloadDelegate) { StartCoroutine(this.LoadSceneCoroutine(sceneName, beforeUnloadDelegate)); }