IEnumerator LoadSceneCoroutine(string sceneName, OnFinishLoadingScene onFinishDelegate) { var operation = SceneManager.LoadSceneAsync(sceneName); while (!operation.isDone) { yield return(null); // wait for next frame } onFinishDelegate(); }
void LoadSceneAsync(string sceneName, OnFinishLoadingScene onFinishDelegate) { StartCoroutine(LoadSceneCoroutine(sceneName, onFinishDelegate)); }