private IEnumerator LoadScene(int sceneIndex) { isLoadingScene = true; OnLoadingSceneBegin?.Invoke(); if (CurrentLevel != NoLevel && CurrentLevel != sceneIndex) { yield return(SceneManager.UnloadSceneAsync(CurrentLevel)); } yield return(SceneManager.LoadSceneAsync(sceneIndex, LoadSceneMode.Additive)); isLoadingScene = false; CurrentLevel = sceneIndex; OnLoadingSceneComplete?.Invoke(); }
void OnSceneLoadCompleted(AsyncOperation opertation) { bIsLoadingScene = false; OnLoadingSceneComplete?.Invoke(); }