public IEnumerator _ReplaceUIScene(string sceneName) { UnityEngine.SceneManagement.Scene beforeScene = currentUIScene; SceneBase beforeSceneBase = currentSceneBase; if (currentUIScene.IsValid() && beforeSceneBase != null) { beforeSceneBase.SetSortingOrderCanvas(12); } currentUIScene = new UnityEngine.SceneManagement.Scene(); currentSceneBase = null; uiSceneNameList.Clear(); if (beforeScene.IsValid() && beforeSceneBase != null) { beforeSceneBase.SetSortingOrderCanvas(11); yield return(beforeSceneBase.Out()); } if (beforeScene.IsValid()) { AsyncOperation oparation2 = UnityEngine.SceneManagement.SceneManager.UnloadSceneAsync(beforeScene); do { yield return(null); } while (oparation2.isDone == false); } beforeUiSceneName = null; AsyncOperation oparation = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(sceneName, UnityEngine.SceneManagement.LoadSceneMode.Additive); do { yield return(null); } while (oparation.isDone == false); yield return(null); currentUIScene = GetSceneBySceneName(sceneName); if (currentUIScene.IsValid()) { currentUISceneName = sceneName; currentSceneBase = GetSceneBase(currentUIScene); uiSceneNameList.Add(sceneName); if (currentSceneBase != null) { currentSceneBase.SetSortingOrderCanvas(12); yield return(currentSceneBase.In()); } } yield return(null); IsLoadingUIScene = false; }