public List <CharacterBean> GetCharacterDataByInfiniteTowersLayer(long layer) { List <CharacterBean> listData = new List <CharacterBean>(); if (layer % 10 == 0) { //Boss层数 string bossTeamMembers = ""; switch (layer) { case 10: case 20: case 30: GameCommonInfo.baseDataController.GetBaseData(BaseDataTypeEnum.InfiniteTowersBossForLevel1, out bossTeamMembers); //bossTeamMembers = "7400011"; break; case 40: case 50: case 60: GameCommonInfo.baseDataController.GetBaseData(BaseDataTypeEnum.InfiniteTowersBossForLevel2, out bossTeamMembers); break; case 70: case 80: case 90: GameCommonInfo.baseDataController.GetBaseData(BaseDataTypeEnum.InfiniteTowersBossForLevel3, out bossTeamMembers); break; case 100: case 110: case 120: GameCommonInfo.baseDataController.GetBaseData(BaseDataTypeEnum.InfiniteTowersBossForLevel4, out bossTeamMembers); break; default: GameCommonInfo.baseDataController.GetBaseData(BaseDataTypeEnum.InfiniteTowersBossForLevel1, out string level1); GameCommonInfo.baseDataController.GetBaseData(BaseDataTypeEnum.InfiniteTowersBossForLevel2, out string level2); GameCommonInfo.baseDataController.GetBaseData(BaseDataTypeEnum.InfiniteTowersBossForLevel2, out string level3); GameCommonInfo.baseDataController.GetBaseData(BaseDataTypeEnum.InfiniteTowersBossForLevel2, out string level4); bossTeamMembers = level1 + "|" + level2 + "|" + level3 + "|" + level4; break; } string[] randomBossTeam = StringUtil.SplitBySubstringForArrayStr(bossTeamMembers, '|'); string bossTeamStr = RandomUtil.GetRandomDataByArray(randomBossTeam); long bossTeamId = StringUtil.SplitAndRandomForLong(bossTeamStr, ','); NpcTeamBean bossTeamData = NpcTeamHandler.Instance.manager.GetInfiniteTowerBossTeam(bossTeamId); long[] membersIds = bossTeamData.GetTeamMembersId(); long[] bossId = bossTeamData.GetTeamLeaderId(); foreach (long itemMemberId in membersIds) { CharacterBean memberData = NpcInfoHandler.Instance.manager.GetCharacterDataById(itemMemberId); if (memberData != null) { memberData.body.CreateRandomBody(); listData.Add(memberData); } } foreach (long itemBossId in bossId) { CharacterBean bossData = NpcInfoHandler.Instance.manager.GetCharacterDataById(itemBossId); if (bossData != null) { //bossData.body.CreateRandomBody(characterBodyManager); listData.Insert((membersIds.Length / 2), bossData); } } } else { //普通层数 List <CharacterBean> listCharacter = NpcInfoHandler.Instance.manager.GetCharacterDataByType(NpcTypeEnum.GuestTeam); List <CharacterBean> listTempCharacter = new List <CharacterBean>(); if (!CheckUtil.ListIsNull(listCharacter)) { for (int i = 0; i < listCharacter.Count; i++) { CharacterBean itemCharacter = listCharacter[i]; //判断层数 int level = int.Parse(itemCharacter.npcInfoData.remark); int layerLevel = Mathf.FloorToInt(layer / 10f); if (layerLevel <= 15 && level == layerLevel) { listTempCharacter.Add(itemCharacter); } } } CharacterBean baseCharacterData = null; if (listTempCharacter.Count == 0) { baseCharacterData = RandomUtil.GetRandomDataByList(listCharacter); } else { baseCharacterData = RandomUtil.GetRandomDataByList(listTempCharacter); } //随机生成身体数据 CharacterBean characterOne = ClassUtil.DeepCopyByReflect(baseCharacterData); characterOne.body.CreateRandomBody(); listData.Add(characterOne); CharacterBean characterTwo = ClassUtil.DeepCopyByReflect(baseCharacterData); characterTwo.body.CreateRandomBody(); listData.Add(characterTwo); CharacterBean characterThree = ClassUtil.DeepCopyByReflect(baseCharacterData); characterThree.body.CreateRandomBody(); listData.Add(characterThree); } return(listData); }