private static IEnumerator LoadSceneInternalTransitionCoroutine(string sceneName) { yield return(instance.StartCoroutine(sceneTransitionManager.LeaveScene())); if (sceneName.StartsWith("index:")) { var index = SafeConvert.ToInt(sceneName.Substring("index:".Length)); m_currentAsyncOperation = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(index); } else { m_currentAsyncOperation = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(sceneName); } while (m_currentAsyncOperation != null && !m_currentAsyncOperation.isDone) { yield return(null); } m_currentAsyncOperation = null; instance.StartCoroutine(sceneTransitionManager.EnterScene()); }
private static IEnumerator LoadSceneInternal(string sceneName) { if (sceneTransitionManager == null) { if (sceneName.StartsWith("index:")) { var index = SafeConvert.ToInt(sceneName.Substring("index:".Length)); UnityEngine.SceneManagement.SceneManager.LoadScene(index); } else { UnityEngine.SceneManagement.SceneManager.LoadScene(sceneName); } yield break; } else { yield return(instance.StartCoroutine(LoadSceneInternalTransitionCoroutine(sceneName))); } }