| | |
| | | |
| | | private bool m_IsToggleOn = false; |
| | | private bool isToggleOn |
| | | { |
| | | { |
| | | get { return m_IsToggleOn; } |
| | | set |
| | | { |
| | |
| | | HeroUIManager.Instance.SortHeroOnTeamList(); |
| | | heroListScroller.OnRefreshCell += OnRefreshCell; |
| | | HeroUIManager.Instance.OnTeamPosChangeEvent += TeamChangeEvent; |
| | | TeamManager.Instance.OnTeamChange += OnTeamChange; |
| | | CreateScroller(); |
| | | Refresh(); |
| | | Display(); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | |
| | | CancelCurrentTask(); |
| | | heroListScroller.OnRefreshCell -= OnRefreshCell; |
| | | HeroUIManager.Instance.OnTeamPosChangeEvent -= TeamChangeEvent; |
| | | TeamManager.Instance.OnTeamChange -= OnTeamChange; |
| | | TeamManager.Instance.GetTeam(HeroUIManager.Instance.selectTeamType).RestoreTeam(); |
| | | } |
| | | |
| | | |
| | | public override void Refresh() |
| | | public void Display() |
| | | { |
| | | OnBattleTeamAttrPer(); |
| | | RefreshOnTeamCountry(); |
| | |
| | | fiterManager.Display(0, HeroUIManager.Instance.selectTeamPosJob, HeroUIManager.Instance.selectTeamPosCountry, SelectJobCountry); |
| | | |
| | | |
| | | fightPowerText.text = "1234k"; |
| | | fightPowerText.text = UIHelper.ReplaceLargeArtNum(FightPowerManager.Instance.GetTeamFightPower(HeroUIManager.Instance.selectTeamType, true)); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | void RefreshFlyHead() |
| | |
| | | } |
| | | |
| | | void RefreshEmptyTip() |
| | | { |
| | | { |
| | | if (HeroUIManager.Instance.heroOnTeamSortList.Count <= 0) |
| | | { |
| | | heroListEmpty.SetActive(true); |
| | |
| | | var team = TeamManager.Instance.GetTeam(HeroUIManager.Instance.selectTeamType); |
| | | if (team != null) |
| | | { |
| | | for (int i = 0; i < team.serverHeroes.Length; i++) |
| | | for (int i = 0; i < team.tempHeroes.Length; i++) |
| | | { |
| | | if (team.serverHeroes[i] == null) |
| | | if (team.tempHeroes[i] == null) |
| | | continue; |
| | | var hero = HeroManager.Instance.GetHero(team.serverHeroes[i].guid); |
| | | var hero = HeroManager.Instance.GetHero(team.tempHeroes[i].guid); |
| | | if (hero != null) |
| | | { |
| | | valuePer += hero.GetOnBattleAddPer(); |
| | |
| | | //上阵属性 |
| | | for (int i = 0; i < attrOnList.Length; i++) |
| | | { |
| | | attrOnList[i].text = PlayerPropertyConfig.GetFullDescription(new Int2(PlayerPropertyConfig.basePerAttrs[i], valuePer)); |
| | | string format = valuePer == 0 ? "{0}+{1}" : "{0}+" + UIHelper.AppendColor(TextColType.Green, "{1}", false); |
| | | attrOnList[i].text = PlayerPropertyConfig.GetFullDescription(PlayerPropertyConfig.basePerAttrs[i], valuePer, format); |
| | | } |
| | | } |
| | | |
| | | //上阵武将国家光环激活 |
| | | void RefreshOnTeamCountry(bool playEffect = false) |
| | | { |
| | | Int2 result = HeroUIManager.Instance.GetMaxCountHeroCountry(HeroUIManager.Instance.selectTeamType); |
| | | Int2 result = HeroUIManager.Instance.GetMaxCountHeroCountry(HeroUIManager.Instance.selectTeamType, true); |
| | | |
| | | var config = HeroLineupHaloConfig.GetConfig(result.x, result.y); |
| | | if (config == null) |
| | |
| | | else |
| | | { |
| | | sceneHero[i].SetActive(true); |
| | | sceneHero[i].Display(teamHero.guid, i, flyFrom >= 0); |
| | | sceneHero[i].Display(teamHero.guid, i, flyFrom >= 0, flyFrom != -2 ? true : false); |
| | | //按scenePosImgs 顺序排序对应位置 |
| | | sceneHero[i].transform.position = scenePosImgs[i].transform.position; |
| | | sceneHero[i].transform.localScale = Vector3.one; |
| | |
| | | RefreshPosScale(); |
| | | heroListScroller.m_Scorller.RefreshActiveCellViews(); |
| | | RefreshOnTeamCountry(true); |
| | | OnBattleTeamAttrPer(); |
| | | |
| | | //表现飞入,连续点击不同头像触发的话则重置 |
| | | if (flyFrom > -1) |
| | |
| | | sequence.onComplete = () => { flyHead.transform.localScale = Vector3.zero; }; |
| | | |
| | | if (isToggleOn) |
| | | { |
| | | { |
| | | ShowFetter(flyHero); |
| | | } |
| | | } |
| | | fightPowerText.text = UIHelper.ReplaceLargeArtNum(FightPowerManager.Instance.GetTeamFightPower(HeroUIManager.Instance.selectTeamType, true)); |
| | | |
| | | } |
| | | |
| | | void ShowFetter(HeroInfo hero) |
| | |
| | | var fetterList = hero.GetActiveFetter(heroConfig, TeamManager.Instance.GetTeam(HeroUIManager.Instance.selectTeamType)); |
| | | for (int i = 0; i < fetterList.Count; i++) |
| | | { |
| | | if(!showConnectTipQueue.Contains(fetterList[i])) |
| | | if (!showConnectTipQueue.Contains(fetterList[i])) |
| | | showConnectTipQueue.Enqueue(fetterList[i]); |
| | | } |
| | | |
| | |
| | | { |
| | | return; |
| | | } |
| | | |
| | | HeroUIManager.Instance.selectTeamPosJob = 0; |
| | | HeroUIManager.Instance.selectTeamPosCountry = 0; |
| | | HeroUIManager.Instance.SortHeroOnTeamList(); |
| | | HeroUIManager.Instance.selectTeamType = type; |
| | | HeroUIManager.Instance.SortHeroOnTeamList(); |
| | | Refresh(); |
| | | heroListScroller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | |
| | | protected void OnTeamChange(TeamType teamType) |
| | | { |
| | | if (HeroUIManager.Instance.selectTeamType == teamType) |
| | | { |
| | | HeroUIManager.Instance.SortHeroOnTeamList(); |
| | | heroListScroller.m_Scorller.RefreshActiveCellViews(); |
| | | } |
| | | } |
| | | } |