From 8f006f426334f5ca733bfe4be2aa91007e232f55 Mon Sep 17 00:00:00 2001 From: hch <305670599@qq.com> Date: 星期四, 16 十月 2025 22:09:37 +0800 Subject: [PATCH] 50 【主界面】核心主体 - 阵容人数解锁 --- Main/System/Main/HeroFightingCardCell.cs | 42 ++++++++++++++++++++++++++++++++++++++---- 1 files changed, 38 insertions(+), 4 deletions(-) diff --git a/Main/System/Main/HeroFightingCardCell.cs b/Main/System/Main/HeroFightingCardCell.cs index 1108afd..410c72c 100644 --- a/Main/System/Main/HeroFightingCardCell.cs +++ b/Main/System/Main/HeroFightingCardCell.cs @@ -17,7 +17,9 @@ [SerializeField] FillTween cdTween; [SerializeField] Button clickEmptyBtn; - + [SerializeField] Image emptyLockImg; + [SerializeField] Image redPointImg; + [SerializeField] UIEffectPlayer unlockEffect; void OnEnable() { @@ -30,16 +32,35 @@ } string guid; - public void Display(int index) + int lockIndex; + public void Display(int index, List<TeamHero> heros) { - var team = TeamManager.Instance.GetTeam(TeamType.Story); - var teamHero = team.GetServerHeroByIndex(index); + TeamHero teamHero = null; + if (index < heros.Count) + { + teamHero = heros[index]; + } guid = teamHero != null ? teamHero.guid : ""; if (guid == "") { clickHeroBtn.SetActive(false); clickEmptyBtn.SetActive(true); clickEmptyBtn.AddListener(ClickEmpty); + emptyLockImg.SetActive(false); + redPointImg.SetActive(false); + + int lockCnt = HeroUIManager.Instance.lockIndexList.Count; + //鏍规嵁閿佹暟閲� 鍊掑簭鍒ゆ柇閿佷綇 + if (lockCnt > 0) + { + lockIndex = lockCnt - (TeamConst.MaxTeamHeroCount - 1 - index) - 1; + if (lockIndex >= 0 && lockIndex < lockCnt) + { + emptyLockImg.SetActive(true); + redPointImg.SetActive(HeroUIManager.Instance.CanUnLock(HeroUIManager.Instance.lockIndexList[lockIndex])); + } + } + return; } else @@ -106,6 +127,19 @@ void ClickEmpty() { + if (emptyLockImg.isActiveAndEnabled) + { + if (HeroUIManager.Instance.UnLockHeroCnt(lockIndex)) + { + unlockEffect.onComplete = () => + { + HeroUIManager.Instance.OnUnLockHeroCountEvent?.Invoke(); + SysNotifyMgr.Instance.ShowTip("HeroCountUnLock5", TeamConst.MaxTeamHeroCount - HeroUIManager.Instance.lockIndexList.Count); + }; + unlockEffect.Play(); + } + return; + } UIManager.Instance.OpenWindow<HeroCallWin>(); } void OnSkillCast(bool isfighting) -- Gitblit v1.8.0