private void MoveToNextMap() { if (m_mapAcrossIDList.Count > 0) { uint fromMapID = this.mapId; m_currentMoveToMapID = m_mapAcrossIDList[0]; m_mapAcrossIDList.Remove(m_currentMoveToMapID); KTabFile <KMapTriggerInfo> focusMap = KConfigFileManager.GetInstance().mapMapsTrigger[fromMapID]; foreach (KeyValuePair <string, KMapTriggerInfo> kmt in focusMap.getAllData()) { if (kmt.Value.ChangeMapID == m_currentMoveToMapID) { string[] pos = kmt.Value.TriggerPoint.Split(';'); if (pos.Length != 2) { Debug.LogError("MoveToNextMap error TriggerPoint; from " + fromMapID.ToString() + "to " + m_currentMoveToMapID.ToString()); } Vector3 target = MapUtils.GetMetreFromInt(int.Parse(pos[0]), int.Parse(pos[1])); this.MainHero.DispatchEvent(ControllerCommand.MOVE_TO_DES, target, true); break; } } } else { m_bInAutoAcrossMap = false; this.MainHero.DispatchEvent(ControllerCommand.MOVE_TO_DES, m_vecTargetPos, true); } }
public HashSet <uint> GetRushSkillSet() { HashSet <uint> sets = new HashSet <uint>(); foreach (KeyValuePair <string, KHeroSetting> kvp in heroSetting.getAllData()) { if (kvp.Value.HeroType == Assets.Scripts.Define.KHeroObjectType.hotPlayer) { sets.Add((uint)kvp.Value.RushSkill); } } return(sets); }
private void SearchMap(KTabFile <KMapTriggerInfo> focusMap, List <uint> haveSearched, List <uint> resultList) { foreach (KeyValuePair <string, KMapTriggerInfo> kmt in focusMap.getAllData()) { uint id = kmt.Value.ChangeMapID; if (haveSearched.IndexOf(id) == -1) { List <uint> tempR = new List <uint>(); tempR.AddRange(resultList); tempR.Add(id); if (id == m_toMapId) { tempR.Remove(m_fromMapId); m_resultList.Add(tempR); break; } else { List <uint> tempH = new List <uint>(); tempH.AddRange(haveSearched); foreach (KeyValuePair <string, KMapTriggerInfo> exitKmt in focusMap.getAllData()) { tempH.Add(exitKmt.Value.ChangeMapID); } if (KConfigFileManager.GetInstance().mapMapsTrigger.ContainsKey(id)) { this.SearchMap(KConfigFileManager.GetInstance().mapMapsTrigger[id], tempH, tempR); } } } } haveSearched = null; resultList = null; }
private void LoadMapListComplet() { LoadComplet(); mapMapsTrigger = new Dictionary <uint, KTabFile <KMapTriggerInfo> >(); foreach (KeyValuePair <string, KMapListSetting> kvp in mapListSetting.getAllData()) { uint mapID = 0; if (!uint.TryParse(kvp.Key, out mapID)) { continue; } KTabFile <KMapTriggerInfo> info = new KTabFile <KMapTriggerInfo>("maps/" + kvp.Key + "/map_trigger", LoadComplet); ++ToBeLoadTotalCount; mapMapsTrigger.Add(mapID, info); } }