internal Map(MapDefine define) { this.Define = define; this.SpawnManager.Init(this); this.MonsterManager.Init(this); this.Battle = new Battle.Battle(this); }
internal Map(MapDefine define, int instanceCount) { this.Define = define; this.SpawnManager.Init(this); this.MonsterManager.Init(this); this.Battle = new Battle.Battle(this); InstanceId = instanceCount; }
private void OnEnterMap(MapDefine define) { mapDefine = define; Sprite sp = ResMgr.GetSprite(define.MiniMap); Map.overrideSprite = sp; Map.SetNativeSize(); }
private void OnEnterMap(MapDefine define) { mapDefine = define; Sprite sp = ResMgr.GetSprite(System.IO.Path.GetFileNameWithoutExtension(define.MiniMap), define.MiniMap); Map.overrideSprite = sp; Map.SetNativeSize(); }
private void EnterMap(int mapId) { if (DataManager.Instance.Maps.ContainsKey(mapId)) { MapDefine map = DataManager.Instance.Maps[mapId]; User.Instance.CurrentMapData = map; SceneManager.Instance.LoadScene(map.Resource); } else { Debug.LogErrorFormat("EnterMap: Map {0} not existed", mapId); } }
/// <summary> /// switch game scene to scene no.mapID /// </summary> /// <param name="mapID"></param> private void SwitchMap(int mapID) { MapDefine define = DataManager.Instance.Maps[mapID]; if (define != null) { ScenesManager.Instance.LoadSceneAsync(define.Resource); Models.User.Instance.currentMapInfo = define; } else { Debug.LogErrorFormat("map {0} cannot be found", mapID); } }
public void EnterMap(int mapId) { if (DataManager.Instance.Maps.ContainsKey(mapId)) { loadingDone = false; MapDefine map = DataManager.Instance.Maps[mapId]; User.Instance.CurrentMapData = map; SceneManager.Instance.LoadScene(map.Resource); SoundManager.Instance.PlayMusic(map.Music); } else { Debug.LogErrorFormat("EnterMap: Map {0} not existed", mapId); } }
void _GenMap(Type type, string mapName, MapDefine mapDefine) { TableType table = m_systemMap [type]; MapData mapData = new MapData(); mapData.type = type; Dictionary <object, object> mapDic = mapData.map; m_map [mapName] = mapData; foreach (object key in table.Keys) { Dictionary <object, object> dic = mapDic; object entry = table[key]; Type entryType = entry.GetType(); for (int i = 0; i < mapDefine.keys.Length; ++i) { string cellName = mapDefine.keys[i]; System.Reflection.PropertyInfo objProperty = entryType.GetProperty(cellName); object cellValue = objProperty.GetValue(entry, null); if (i == mapDefine.keys.Length - 1) { List <object> list = null; if (dic.ContainsKey(cellValue)) { list = (List <object>)dic[cellValue]; } else { list = new List <object>(); dic[cellValue] = list; } list.Add(key); } else { if (!dic.ContainsKey(cellValue)) { dic[cellValue] = new Dictionary <object, object>(); } dic = (Dictionary <object, object>)dic[cellValue]; } } } }
private void EnterMap(int mapId) { if (DataManager.Instance.Maps.ContainsKey(mapId)) { MapDefine map = DataManager.Instance.Maps[mapId]; //Models.User.Instance.CurrentMapData = map; GameManager.SceneMgr.LoadScene(map.Resource, delegate { GameManager.UIMgr.OpenUI <UIMainCity>("Main"); GameManager.UIMgr.OpenUI <UIMiniMap>("Main"); }); } else { Debug.LogError("该地图不存在:" + mapId); } }
public void GenMap <T>(string mapName, string[] keys) where T : ProtoBuf.IExtensible { Type type = typeof(T); MapDefine mapDefine = new MapDefine(); mapDefine.keys = keys; GetTable <T>(); if (!m_mapDefines.ContainsKey(type)) { m_mapDefines[type] = new Dictionary <string, MapDefine>(); } m_mapDefines [type] [mapName] = mapDefine; if (m_systemMap.ContainsKey(type)) { _GenMap(type, mapName, mapDefine); } }
/// <summary> /// constructor function /// </summary> /// <param name="defn"></param> internal Map(MapDefine defn) { Log.InfoFormat("Map -> Map(): Mapid: {0}, MapName: {1}", defn.ID, defn.Name); this.mapDefine = defn; }
internal Map(MapDefine define) { this.Define = define; }