| | |
| | | teamDict.Clear(); |
| | | } |
| | | |
| | | public void OnHeroChangeEvent(HB124_tagSCLineupInfo vNetData) |
| | | public void OnHeroChangeEvent(HB124_tagSCHeroPresetInfo vNetData) |
| | | { |
| | | var heroPack = PackManager.Instance.GetSinglePack(PackType.Hero); |
| | | HashSet<TeamType> teamTypeSet = new HashSet<TeamType>(); |
| | | for (int i = 0; i < vNetData.LineupCnt; i++) |
| | | for (int i = 0; i < vNetData.PresetCnt; i++) |
| | | { |
| | | TeamType teamType = (TeamType)vNetData.LineupList[i].LineupID; |
| | | TeamType teamType = (TeamType)vNetData.PresetList[i].PresetID; |
| | | teamTypeSet.Add(teamType); |
| | | var team = GetTeam(teamType); |
| | | for (int j = 0; j < vNetData.LineupList[i].HeroCnt; j++) |
| | | for (int j = 0; j < vNetData.PresetList[i].HeroCnt; j++) |
| | | { |
| | | int index = vNetData.LineupList[i].HeroItemIndexList[j]; |
| | | int index = vNetData.PresetList[i].HeroItemIndexList[j]; |
| | | HeroInfo hero; |
| | | if (index == 0) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | var item = heroPack.GetItemByIndex(vNetData.LineupList[i].HeroItemIndexList[j] - 1); |
| | | var item = heroPack.GetItemByIndex(vNetData.PresetList[i].HeroItemIndexList[j] - 1); |
| | | if (item == null) |
| | | { |
| | | hero = null; |
| | |
| | | hero = HeroManager.Instance.GetHero(item.guid); |
| | | |
| | | } |
| | | team.RefreshServerData(vNetData.LineupList[i].ShapeType, j, hero); |
| | | team.RefreshServerData(vNetData.PresetList[i].ShapeType, j, hero); |
| | | } |
| | | } |
| | | |