private void SetMonsterList(int mapId, GameObject gameObject) { int firstRuleId = Cfg_Map.GetCfg(mapId).GenMonsterRule; List <int> genRuleList = new List <int>() { firstRuleId }; for (int i = 0; i < 100; i++) { int nextRule = Cfg_GenMon.GetCfg(firstRuleId).NextRule; if (nextRule != 0) { genRuleList.Add(nextRule); firstRuleId = nextRule; } else { break; } } //foreach (var genRuleId in genRuleList) //{ // Cfg_GenMon cfg_GenMon = Cfg_GenMon.GetCfg(genRuleId); // Cfg_NPC cfg_NPC = Cfg_NPC.GetCfg(cfg_GenMon.MonsterId); // UI_ListItem = UIBase.InitListItem(gameObject); // string Asset = COMMON.MonsterIconPath + cfg_NPC.AssetName; // UIBase.SetImageSpite(UI_ListItem.Images[0], Asset); //} UIBase.ResetListPos(gameObject); }
public static void MapGenMonster(List <BrickRoot> brickRoots, int mapId) { int ruleId = Cfg_Map.GetCfg(mapId).GenMonsterRule; Cfg_GenMon cfg_GenMon = Cfg_GenMon.GetCfg(ruleId); //怪物ID列表 List <int> monsterList = new List <int>(); //掉落列表 List <int> dropList = new List <int>(); for (int i = 0; i < 100; i++) { switch (cfg_GenMon.Type) { case 0: monsterList.Add(cfg_GenMon.Parameter); break; case 1: dropList.Add(cfg_GenMon.Parameter); break; } if (cfg_GenMon.NextRule != 0) { cfg_GenMon = Cfg_GenMon.GetCfg(cfg_GenMon.NextRule); } else { break; } } //生成怪物 List <BrickRoot> bricks = GenBrickMonster(brickRoots, monsterList); //生成装备 GenBrickEquip(bricks, dropList); }