yyl
2026-03-26 f4a702e212d1853735f8dae399da69d23bfa510e
Main/System/HeroUI/HeroCollectionCardCell.cs
@@ -1,7 +1,6 @@
using UnityEngine;
using UnityEngine;
using UnityEngine.UI;
using System.Collections.Generic;
using Cysharp.Threading.Tasks;
public class HeroCollectionCardCell : MonoBehaviour
{
@@ -17,7 +16,7 @@
    // [SerializeField] Button bookLVBtn;
    [SerializeField] GameObject unGetObj;
    [SerializeField] GameObject activeObj; // 可激活带流光效果材质
    [SerializeField] GameObject actLimitObj; // 活动限定
    public void Display(int index, int quality)
    {
        var heroID = HeroUIManager.Instance.heroCollectDict[quality][index];
@@ -35,6 +34,7 @@
        activeObj.SetActive(funcState == 1);
        // bookLVBtn.SetActive(funcState > 1);
        unGetObj.SetActive(funcState == 0);
        actLimitObj.SetActive(heroConfig.IsActLimit == 1);
        countryImg.SetSprite(HeroUIManager.Instance.GetCountryIconName(heroConfig.Country));
        jobImg.SetSprite(HeroUIManager.Instance.GetJobIconName(heroConfig.Class));
@@ -51,25 +51,11 @@
        {
            trainStateImg.SetActive(false);
        }
        nameText.text = colData.BookBreakLV == 0 ? heroConfig.Name : Language.Get("herocardbreaklv", heroConfig.Name, colData.BookBreakLV);
        nameText.text = heroConfig.Name;
        for (int i = 0; i < starImgList.Count; i++)
        {
            if (colData.BookStarLV == 0 && i == 0)
            {
                // 无星级 特殊处理
                starImgList[i].SetActive(true);
                starImgList[i].SetSprite("herostar" + colData.BookStarLV);
            }
            else if ((colData.BookStarLV - 1) % starImgList.Count >= i)
            {
                starImgList[i].SetActive(true);
                starImgList[i].SetSprite("herostar" + (((colData.BookStarLV - 1) / starImgList.Count) + 1) * starImgList.Count);
            }
            else
            {
                starImgList[i].SetActive(false);
            }
            starImgList[i].SetActive(false);
        }
        heroCardBtn.AddListener(() =>
@@ -78,19 +64,19 @@
            var state = HeroUIManager.Instance.GetHeroBookState(heroID, quality);
            if (state == 1 || state == 3 || state == 4)
            {
                UIManager.Instance.OpenWindowAsync<HeroCollectionLvUpWin>().Forget();
                UIManager.Instance.OpenWindow<HeroCollectionLvUpWin>();
            }
            else
            {
                HeroUIManager.Instance.selectForPreviewHeroID = heroID;
                UIManager.Instance.OpenWindowAsync<HeroBestWin>().Forget();
                UIManager.Instance.OpenWindow<HeroBestBaseWin>();
            }
        });
        
        // bookLVBtn.AddListener(() =>
        // {
        //     HeroUIManager.Instance.selectCollectHeroID = heroID;
        //     UIManager.Instance.OpenWindowAsync<HeroCollectionLvUpWin>().Forget();
        //     UIManager.Instance.OpenWindow<HeroCollectionLvUpWin>();
        // });
    }
}