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(); }
private void OnLoadStaticData(Entity ent) { m_bModelLoaded = true; if (m_sceneInfo.staticData == 0) { OnLoadBgm(); return; } m_staticDynamic = (SceneDataResource)ResourceFactory.Inst.LoadResource(m_sceneInfo.staticData, (res) => { OnLoadBgm(); }); }