yyl
2026-02-11 3f2cd27c5dfb3b450245bf1a37fc1b3414031c7c
Main/System/HeroUI/HeroConnectionHeadCell.cs
@@ -1,5 +1,6 @@
using UnityEngine;
using UnityEngine.UI;
using Cysharp.Threading.Tasks;
//羁绊中的武将
public class HeroConnectionHeadCell : MonoBehaviour
@@ -52,5 +53,43 @@
        connMarkImg.SetActive(index != 0);
    }
    public async UniTask DisplayAsync(int heroID, int index, bool showCollect = false, int _skinID = 0)
    {
        int skinID = 0;
        HeroConfig heroConfig = HeroConfig.Get(heroID);
        if (_skinID != 0)
        {
            skinID = _skinID;
        }
        else
        {
            skinID = heroConfig.SkinIDList[0];  //默认第一个图鉴展示
        }
        nameText.text = heroConfig.Name;
        qualityImg.SetSprite("heroheadBG" + heroConfig.Quality);
        var sprite = await UILoader.LoadSpriteAsync("HeroHead", HeroSkinConfig.Get(skinID).SquareIcon);
        if (this == null) return;
        if (sprite == null)
        {
            // 内网未配置时
            heroIcon.SetSprite("herohead_default");
        }
        else
        {
            heroIcon.overrideSprite = sprite;
        }
        if (showCollect)
        {
            //未获得武将要置灰
            heroIcon.gray = !HeroManager.Instance.HasHero(heroID);
        }
        connMarkImg.SetActive(index != 0);
    }
}