Exemplo n.º 1
0
 private void OnUnLoadSceneComplete(SceneLoaderRoutine routine)
 {
     m_SceneLoaderList.Remove(routine);
     GameEntry.Pool.EnqueueClassObject(routine);
     m_CurrLoadOrUnloadSceneDetailCount++;
     if (m_NeedLoadOrUnloadSceneDetailCount == m_CurrLoadOrUnloadSceneDetailCount)
     {
         Resources.UnloadUnusedAssets();
         m_NeedLoadOrUnloadSceneDetailCount = 0;
         m_CurrLoadOrUnloadSceneDetailCount = 0;
         LoadNewScene();
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 加载新场景
        /// </summary>
        private void LoadNewScene()
        {
            m_CurrSceneEntity     = GameEntry.DataTable.DataTableManager.Sys_SceneDBModel.Get(m_CurrLoadSceneId);
            m_CurrSceneDetailList = GameEntry.DataTable.DataTableManager.Sys_SceneDatailDBModel.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_SceneDatailEntity entity = m_CurrSceneDetailList[i];
                routine.LoadScene(entity.Id, entity.ScenePath, OnLoadSceneProgressUpdate, OnLoadSceneComplete);
            }
        }
Exemplo n.º 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();
     }
 }
Exemplo n.º 4
0
 private void OnLoadSceneComplete(SceneLoaderRoutine routine)
 {
     m_SceneLoaderList.Remove(routine);
     GameEntry.Pool.EnqueueClassObject(routine);
 }