Main/System/Arena/HeroCountryComponent.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Main/System/Battle/ArenaBattleWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Main/System/HeroUI/HeroFormationCell.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Main/System/HeroUI/HeroFormationWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Main/System/HeroUI/HeroPosWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Main/System/HeroUI/HeroUIManager.OnTeam.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Main/System/HeroUI/HeroUIManager.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Main/System/Arena/HeroCountryComponent.cs
@@ -4,100 +4,26 @@ public class HeroCountryComponent : MonoBehaviour { [SerializeField] Button countryOnBtn; [SerializeField] Image countryOnImg; //上阵阵型激活国家 [SerializeField] UIEffectPlayer countryEffect; [SerializeField] List<Image> OnCountImgs; //上阵数量激活 /// <summary> /// 上阵队伍中各个国家的武将数量 /// </summary> public Dictionary<HeroCountry, int> GetCountryHeroCountByTeamType(List<TeamHero> teamHeroes) List<TeamHero> teamHeroes; void Awake() { Dictionary<HeroCountry, int> heroCountryCount = new Dictionary<HeroCountry, int>(); if (teamHeroes == null) countryOnBtn.AddListener(() => { return heroCountryCount; } for (int i = 0; i < teamHeroes.Count; i++) { if (teamHeroes[i] == null) continue; var country = teamHeroes[i].Country; if (!heroCountryCount.ContainsKey(country)) { heroCountryCount.Add(country, 1); } else { heroCountryCount[country] += 1; } } return heroCountryCount; } /// <summary> /// 获得上阵中武将数量最大的国家和数量 /// </summary> public Int2 GetMaxCountHeroCountry(List<TeamHero> teamType) { var countryCountDict = GetCountryHeroCountByTeamType(teamType); //找到最大的国家和数量 HeroCountry country = HeroCountry.None; int maxValue = 0; foreach (var data in countryCountDict) { if (data.Value > maxValue) { country = data.Key; maxValue = data.Value; } } return new Int2((int)country, maxValue); HeroUIManager.Instance.isCustonHeroFormation = true; HeroUIManager.Instance.custonTeamHeroes = teamHeroes; UIManager.Instance.OpenWindow<HeroFormationWin>(); }); } //上阵武将国家光环激活 public void RefreshOnTeamCountry(List<TeamHero> teamType, bool playEffect = false) public void RefreshOnTeamCountry(List<TeamHero> teamHeroes, bool playEffect = false) { Int2 result = GetMaxCountHeroCountry(teamType); var config = HeroLineupHaloConfig.GetConfig(result.x, result.y); if (config == null) { countryOnImg.SetSprite("heroTeamCountry0"); for (int i = 0; i < OnCountImgs.Count; i++) { OnCountImgs[i].SetActive(false); } } else { countryOnImg.SetSprite("heroTeamCountry" + result.x); for (int i = 0; i < OnCountImgs.Count; i++) { if (i < result.y) { OnCountImgs[i].SetActive(true); OnCountImgs[i].SetSprite("heroTeamCountryPoint" + result.x); } else { OnCountImgs[i].SetActive(false); } } if (playEffect) countryEffect.Play(); } } //上阵武将国家光环激活 public void RefreshOnTeamCountry(TeamType selectTeamType, bool playEffect = false) { Int2 result = HeroUIManager.Instance.GetMaxCountHeroCountry(selectTeamType, true); this.teamHeroes = teamHeroes; Int2 result = HeroUIManager.Instance.GetMaxCountHeroCountry(teamHeroes); var config = HeroLineupHaloConfig.GetConfig(result.x, result.y); if (config == null) Main/System/Battle/ArenaBattleWin.cs
@@ -210,7 +210,8 @@ txtMyName.text = PlayerDatas.Instance.baseData.PlayerName; txtMyFightPonit.text = UIHelper.ReplaceLargeArtNum(PlayerDatas.Instance.baseData.FightPower); myAvatarCell.InitUI(AvatarHelper.GetAvatarModel((int)PlayerDatas.Instance.baseData.PlayerID, PlayerDatas.Instance.baseData.face, PlayerDatas.Instance.baseData.facePic)); myCountry.RefreshOnTeamCountry(TeamType.Arena); team = GetTeamHeroList(myTeam); myCountry.RefreshOnTeamCountry(team, true); for (int i = 0; i < myHeroHeads.Count; i++) { Main/System/HeroUI/HeroFormationCell.cs
@@ -12,7 +12,15 @@ public void Display(int index) { Int2 result = HeroUIManager.Instance.GetMaxCountHeroCountry(HeroUIManager.Instance.selectTeamType, true); Int2 result; if (HeroUIManager.Instance.isCustonHeroFormation) { result = HeroUIManager.Instance.GetMaxCountHeroCountry(HeroUIManager.Instance.custonTeamHeroes);; } else { result = HeroUIManager.Instance.GetMaxCountHeroCountry(HeroUIManager.Instance.selectTeamType, true); } var config = HeroLineupHaloConfig.GetConfig(result.x, result.y); bool sameCountry = result.x == (index + 1); Main/System/HeroUI/HeroFormationWin.cs
@@ -23,8 +23,16 @@ { scroller.OnRefreshCell += OnRefreshCell; CreateScroller(); Int2 result; if (HeroUIManager.Instance.isCustonHeroFormation) { result = HeroUIManager.Instance.GetMaxCountHeroCountry(HeroUIManager.Instance.custonTeamHeroes);; } else { result = HeroUIManager.Instance.GetMaxCountHeroCountry(HeroUIManager.Instance.selectTeamType, true); } Int2 result = HeroUIManager.Instance.GetMaxCountHeroCountry(HeroUIManager.Instance.selectTeamType, true); var config = HeroLineupHaloConfig.GetConfig(result.x, result.y); if (config == null) Main/System/HeroUI/HeroPosWin.cs
@@ -100,6 +100,7 @@ countryOnBtn.AddListener(() => { HeroUIManager.Instance.isCustonHeroFormation = false; UIManager.Instance.OpenWindow<HeroFormationWin>(); }); Main/System/HeroUI/HeroUIManager.OnTeam.cs
@@ -198,6 +198,37 @@ } /// <summary> /// 获得自定义队伍中各个国家的武将数量 /// </summary> public Dictionary<HeroCountry, int> GetCountryHeroCountByTeamHeroList(List<TeamHero> teamHeroes) { Dictionary<HeroCountry, int> heroCountryCount = new Dictionary<HeroCountry, int>(); if (teamHeroes == null) { return heroCountryCount; } for (int i = 0; i < teamHeroes.Count; i++) { if (teamHeroes[i] == null) continue; var country = teamHeroes[i].Country; if (!heroCountryCount.ContainsKey(country)) { heroCountryCount.Add(country, 1); } else { heroCountryCount[country] += 1; } } return heroCountryCount; } /// <summary> /// 获得上阵中武将数量最大的国家和数量 /// </summary> /// <param name="teamType"></param> @@ -220,6 +251,26 @@ return new Int2((int)country, maxValue); } /// <summary> /// 获得自定义队伍中武将数量最大的国家和数量 /// </summary> public Int2 GetMaxCountHeroCountry(List<TeamHero> teamType) { var countryCountDict = GetCountryHeroCountByTeamHeroList(teamType); //找到最大的国家和数量 HeroCountry country = HeroCountry.None; int maxValue = 0; foreach (var data in countryCountDict) { if (data.Value > maxValue) { country = data.Key; maxValue = data.Value; } } return new Int2((int)country, maxValue); } //在不同页签下选AttackType 0 攻击阵容 1 防守阵容 public int GetSelectTeamTypeByAttackType(int AttackType) { Main/System/HeroUI/HeroUIManager.cs
@@ -24,6 +24,10 @@ //使用方法:其他功能界面设置该值即可 public KeyValuePair<string, long> lastFightPower = new KeyValuePair<string, long>(); public bool isCustonHeroFormation = false; public List<TeamHero> custonTeamHeroes = new List<TeamHero>(); public override void Init() { DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;