void UpdateCampChessCountDict() { List <string> cnames = _mgr.GetMiroPrefabsCampNames(); foreach (string cname in cnames) { _CampChessCount [cname] = 0; } /* * int prefCnt = _mgr._MiroPrefabs.Count; * for (int i = 0; i < prefCnt; i++) { * MiroV1ModelSetting setting = _mgr._MiroPrefabs [i].GetComponent<MiroV1ModelSetting> (); * if (_CampChessCount.ContainsKey (setting._CampName)) { * _CampChessCount [setting._CampName] = 0; * } * }*/ foreach (GameObject ctrlObj in _gridCtrl._Cells) { CellObjCtrl ctrl = ctrlObj.GetComponent <CellObjCtrl> (); MiroV1ModelSetting setting = CellObjCtrlUtils.GetModelSettingFromCtrl(ctrl); if (setting != null) { string cname = setting._CampName; if (!_CampChessCount.ContainsKey(cname)) { _CampChessCount [cname] = 0; } else { _CampChessCount [cname]++; } } } }
public void PrintAllChessInfo() { var birthIDs = new List <int> (); var positions = new List <Hex> (); var directions = new List <int> (); var campIds = new List <int> (); _Port.GetAllChessesInfo( out birthIDs, out positions, out directions, out campIds); List <string> campNames = _placeMgr.GetMiroPrefabsCampNames(); for (int i = 0; i < birthIDs.Count; i++) { string campName = campNames [campIds [i]]; string info = campName + " " + birthIDs [i].ToString(); info += " at " + HexToString(positions [i]); info += " in dir " + directions [i].ToString(); print(info); } }