Example #1
0
    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();
    }
Example #2
0
 void OnSceneLoadCompleted(AsyncOperation opertation)
 {
     bIsLoadingScene = false;
     OnLoadingSceneComplete?.Invoke();
 }