public void LoadScene(int mapID) { switchLockBoo = true; EventMgr.Instance.TriggerEvent(SceneConst.SWITCH_SCENE_STAR); UIMgr.Instance.OpenView <LoadingView>("LoadingView"); EventMgr.Instance.TriggerEvent <string, int>(SceneConst.SWITCH_SCENE_PROGRESS, "开始加载场景", 5); MapExcel tempMapData = DataMgr.Instance.tableMap.GetInfoById(mapID); switchMapID = mapID; string scenePath = SCENE_PATH + tempMapData.mapResId.ToString() + ".unity"; uint crc = CRC32.GetCRC32(scenePath); if (holdSceneList.Contains(crc) || sceneList.Contains(crc)) { switchSceneID = tempMapData.mapResId; } else { ResourcesMgr.Instance.LoadResourceScene(scenePath); switchSceneID = tempMapData.mapResId; } EventMgr.Instance.TriggerEvent <string, int>(SceneConst.SWITCH_SCENE_PROGRESS, "开始加载场景", 15); switchAsyncBoo = true; }
void OnMpaSelectCallBack(object userData) { int tempMapId = (int)userData; if (tempMapId == 0) { Debug.LogError("地图ID为0"); return; } if (tempMapId == mapID) { return; } mapID = tempMapId; MapExcel tempMapData = tableMap.GetInfoById(mapID); mapName = tempMapData.name; MapEditModel.Instance.Init(); MapEditModel.Instance.curMapId = mapID; MapEditModel.Instance.LoadScene(tempMapData.mapResId); string tempCPath1 = Application.dataPath + _scriptEditPath + "Map" + mapID + "EditConfig.cs"; if (File.Exists(tempCPath1)) { MapEditModel.Instance.LoadMapConfig(mapID); } ClearAllGoDic(); _isInitBoo = false; InitAllGo(); this.Repaint(); }
public void AddInfo(MapExcel _info) { DataList.Add(_info); }