hch
5 天以前 8f006f426334f5ca733bfe4be2aa91007e232f55
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)