Exemple #1
0
        public void UnLoadScene()
        {
            // 销毁场景模型
            if (m_ent != null)
            {
                EntityManager.Inst.RemoveEntity(m_ent.m_hid);
            }
            if (m_colliderEnt != null)
            {
                EntityManager.Inst.RemoveEntity(m_colliderEnt.m_hid);
            }
            // 销毁地图动态障碍数据
            if (m_staticDynamic != null)
            {
                ResourceFactory.Inst.UnLoadResource(m_staticDynamic);
                m_staticDynamic = null;
            }
            // 销毁声音
            if (m_soundEnt != null)
            {
                EntityManager.Inst.RemoveEntity(m_soundEnt.m_hid);
                m_soundEnt = null;
            }

            m_sceneInfo        = null;
            m_bModelLoaded     = false;
            m_bSceneDataLoaded = false;

            SceneManager.Inst.GetMapLoadProcess().fPercent = 0f;

            // 清除实体缓存
            EntityManager.Inst.ClearCache();
        }
Exemple #2
0
        public void LoadScene(int sceneID, Action loadEnd)
        {
            m_sceneLoaded = loadEnd;
            SceneCsv csvScene = CsvManager.Inst.GetCsv <SceneCsv>((int)eAllCSV.eAC_Scene);

            m_sceneInfo = csvScene.GetData(sceneID);
            if (m_sceneInfo == null)
            {
                Debug.LogError("地图表缺少配置:" + sceneID);
                return;
            }
            OnLoadModel();
        }
Exemple #3
0
 protected override void _Load()
 {
     for (int i = 0; i < m_csv.GetRows(); i++)
     {
         SceneCsvData ani = new SceneCsvData();
         ani.id         = m_csv.GetIntData(i, (int)eMapCsv_Enum.eID);
         ani.name       = m_csv.GetData(i, (int)eMapCsv_Enum.eName);
         ani.resId      = m_csv.GetIntData(i, (int)eMapCsv_Enum.eResId);
         ani.collider   = m_csv.GetIntData(i, (int)eMapCsv_Enum.eCollider);
         ani.staticData = m_csv.GetIntData(i, (int)eMapCsv_Enum.eStaticData);
         ani.bgm        = m_csv.GetIntData(i, (int)eMapCsv_Enum.eBgm);
         string pos = m_csv.GetData(i, (int)eMapCsv_Enum.bornPoint);
         ani.bornPoint = StringHelper.GetVector3(pos);
         m_mapDataDic.Add(ani.id, ani);
     }
 }