Пример #1
0
        private void OnUnLoadSceneComplete(SceneLoaderRoutine routine)
        {
            m_SceneLoaderList.Remove(routine);
            GameEntry.Pool.EnqueueClassObject(routine);

            m_CurrLoadOrUnloadSceneDetailCount++;
            if (m_CurrLoadOrUnloadSceneDetailCount == m_NeedLoadOrUnloadSceneDetailCount)
            {
                Resources.UnloadUnusedAssets();
                m_NeedLoadOrUnloadSceneDetailCount = 0;
                m_CurrLoadOrUnloadSceneDetailCount = 0;
                LoadNewScene();
            }
        }
Пример #2
0
        /// <summary>
        /// 加载新场景
        /// </summary>
        private void LoadNewScene()
        {
            m_CurrSceneEntity     = GameEntry.DataTable.DataTableManager.Sys_SceneDBModel.Get(m_CurrLoadSceneId);
            m_CurrSceneDetailList = GameEntry.DataTable.DataTableManager.Sys_SceneDetailDBModel.GetListBySceneId(m_CurrSceneEntity.Id, 2);
            m_NeedLoadOrUnloadSceneDetailCount = m_CurrSceneDetailList.Count;

            for (int i = 0; i < m_NeedLoadOrUnloadSceneDetailCount; i++)
            {
                SceneLoaderRoutine routine = GameEntry.Pool.DequeueClassObject <SceneLoaderRoutine>();
                m_SceneLoaderList.AddLast(routine);

                Sys_SceneDetailEntity entity = m_CurrSceneDetailList[i];
                routine.LoadScene(entity.Id, entity.ScenePath, OnLoadSceneProgressUpdate, OnLoadSceneComplete);
            }
        }
Пример #3
0
 /// <summary>
 /// 卸载当前场景
 /// </summary>
 private void UnLoadCurrScene()
 {
     if (m_CurrSceneEntity != null)
     {
         m_NeedLoadOrUnloadSceneDetailCount = m_CurrSceneDetailList.Count;
         for (int i = 0; i < m_NeedLoadOrUnloadSceneDetailCount; i++)
         {
             SceneLoaderRoutine routine = GameEntry.Pool.DequeueClassObject <SceneLoaderRoutine>();
             m_SceneLoaderList.AddLast(routine);
             routine.UnLoadScene(m_CurrSceneDetailList[i].ScenePath, OnUnLoadSceneComplete);
         }
     }
     else
     {
         LoadNewScene();
     }
 }
Пример #4
0
 private void OnLoadSceneComplete(SceneLoaderRoutine routine)
 {
     m_SceneLoaderList.Remove(routine);
     GameEntry.Pool.EnqueueClassObject(routine);
 }