Exemplo n.º 1
0
    private IEnumerator AsyncLoadScene(SceneNameList.SceneNameHolder sceneName)
    {
//				Debug.Log("Start");
        yield return(StartCoroutine(this.LoadLoadingScene(sceneName)));

        yield return(StartCoroutine(this.LoadTargetScene(sceneName)));
    }
Exemplo n.º 2
0
    private IEnumerator LoadTargetScene(SceneNameList.SceneNameHolder sceneName)
    {
        this.status = Status.Loading;

        if (string.IsNullOrEmpty(sceneName.sceneName))
        {
            this.status = Status.None;
            yield break;
        }

        this.loadOperation = SceneManager.LoadSceneAsync(sceneName.sceneName, LoadSceneMode.Single);
        yield return(this.loadOperation);

        this.status = Status.Complete;
    }
Exemplo n.º 3
0
    private IEnumerator LoadLoadingScene(SceneNameList.SceneNameHolder sceneName)
    {
        if (string.IsNullOrEmpty(sceneName.loadingSceneName))
        {
            yield break;
        }

        this.status = Status.Prepare;
        Debug.Log(sceneName.loadingSceneName);

        this.loadOperation = sceneName.isAdditiveLoading ? SceneManager.LoadSceneAsync(sceneName.loadingSceneName, LoadSceneMode.Additive) : SceneManager.LoadSceneAsync(sceneName.loadingSceneName, LoadSceneMode.Single);

        yield return(this.loadOperation);

        while (this.status == Status.Prepare)
        {
            yield return(null);
        }
    }