IEnumerator LoadScene_C(E_SCENE_TYPE _sceneType) { yield return(new WaitForSeconds(4.0f)); Debug.Log(_sceneType.ToString() + " Try to loading Scene"); string sceneName = Common.GetSceneName(_sceneType); AsyncOperation Op = SceneManager.LoadSceneAsync(sceneName, LoadSceneMode.Single); Op.allowSceneActivation = false; while (!Op.isDone) { yield return(null); Debug.Log(sceneName.ToString() + " Loading..."); if (Op.progress >= 0.9f) { m_sceneType = _sceneType; Op.allowSceneActivation = true; } } }
static public string GetSceneName(E_SCENE_TYPE _sceneType) { string sceneName = "scene_" + _sceneType.ToString(); return(sceneName); }