| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using UnityEngine; |
| | | |
| | | using System; |
| | | |
| | | |
| | | public class TeamManager : GameSystemManager<TeamManager> |
| | | { |
| | | protected Dictionary<TeamType, TeamBase> teamDict = new Dictionary<TeamType, TeamBase>(); |
| | | |
| | | public Action<TeamType> OnTeamChange = null; |
| | | |
| | | public override void Init() |
| | | { |
| | |
| | | public void OnHeroChangeEvent(HB124_tagSCLineupInfo vNetData) |
| | | { |
| | | var heroPack = PackManager.Instance.GetSinglePack(PackType.Hero); |
| | | HashSet<TeamType> teamTypeSet = new HashSet<TeamType>(); |
| | | for (int i = 0; i < vNetData.LineupCnt; i++) |
| | | { |
| | | var team = GetTeam((TeamType)vNetData.LineupList[i].LineupID); |
| | | TeamType teamType = (TeamType)vNetData.LineupList[i].LineupID; |
| | | teamTypeSet.Add(teamType); |
| | | var team = GetTeam(teamType); |
| | | for (int j = 0; j < vNetData.LineupList[i].HeroCnt; j++) |
| | | { |
| | | int index = vNetData.LineupList[i].HeroItemIndexList[j]; |
| | |
| | | team.RefreshServerData(vNetData.LineupList[i].ShapeType, j, hero); |
| | | } |
| | | } |
| | | } |
| | | |
| | | foreach (var tt in teamTypeSet) |
| | | { |
| | | OnTeamChange?.Invoke(tt); |
| | | } |
| | | } |
| | | |
| | | |
| | | public bool HasTeam(TeamType teamType) |