Ejemplo n.º 1
0
        private void UnLoadCompleteCallBack(SceneLoderRoutine loader)
        {
            if (loader == null)
            {
                GameEntry.Logger.Write($"UnLoadCompleteCallBack Loader Is Null,Scene Name:{m_CurSceneName}", UnityEngine.LogType.Exception);
            }

            m_SceneLoaderList.Remove(loader);
            GameEntry.Pool.PushClass <SceneLoderRoutine>(loader);

            LoadNewScene();
        }
Ejemplo n.º 2
0
 private void UnLoadScene()
 {
     if (string.IsNullOrEmpty(m_CurSceneName))
     {
         LoadNewScene();
     }
     else
     {
         m_NeedLoadOrUnloadSceneDetailCount = 1;
         //卸载
         SceneLoderRoutine routine = GameEntry.Pool.PopClass <SceneLoderRoutine>();
         m_SceneLoaderList.AddLast(routine);
         routine.UnLoad(m_CurSceneName, UnLoadCompleteCallBack);
     }
 }
Ejemplo n.º 3
0
        private void LoadCompleteCallBack(SceneLoderRoutine routine)
        {
            if (routine == null)
            {
                return;
            }

            m_CurrLoadOrUnloadSceneDetailCount++;
            if (m_CurrLoadOrUnloadSceneDetailCount == m_NeedLoadOrUnloadSceneDetailCount)
            {
                m_SceneLoaderList.Remove(routine);
                GameEntry.Pool.PushClass <SceneLoderRoutine>(routine);
                m_CurrLoadOrUnloadSceneDetailCount = 0;
                m_NeedLoadOrUnloadSceneDetailCount = 0;
            }
        }
Ejemplo n.º 4
0
        private void LoadNewScene()
        {
            m_NeedLoadOrUnloadSceneDetailCount = 1;
            //GetSceneName ToDo
            if (m_CurLoadSceneId == 1)
            {
                m_CurSceneName = "Main";
            }
            else
            {
                m_CurSceneName = "Fight";
            }

            SceneLoderRoutine routine = GameEntry.Pool.PopClass <SceneLoderRoutine>();

            m_SceneLoaderList.AddLast(routine);
            routine.LoadScene(m_CurLoadSceneId, m_CurSceneName, OnLoadSceneProgressUpdate, LoadCompleteCallBack);
        }