public void OnSceneDeactivated(SceneBehaviour scene) { if (m_current == scene) { m_current = null; } }
IEnumerator yLoadScene(string sceneName, SceneTransition transition) { m_state = State.Loading; if (m_handler != null) { m_handler.OnLoadBegan(sceneName); } if (transition != null) { yield return(transition.Enter()); } if (m_handler != null) { var process = m_handler.OnLoadPreprocess(sceneName); if (process != null) { yield return(process); } } m_current = null; yield return(UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(sceneName, UnityEngine.SceneManagement.LoadSceneMode.Single)); while (!m_current || !m_current.IsSetup) { if (m_current && m_current.IsError) { yield return(UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(m_defaultSceneName, UnityEngine.SceneManagement.LoadSceneMode.Single)); } yield return(null); } // フェードが明けるのはロード完了合図してから m_state = State.Transiting; if (m_handler != null) { m_handler.OnLoadEnded(sceneName); } if (transition != null) { yield return(transition.Exit()); } m_state = State.None; }
//------------------------------------------------------ // scene behaviour //------------------------------------------------------ public void OnSceneActivated(SceneBehaviour scene) { m_current = scene; }