From 3f2cd27c5dfb3b450245bf1a37fc1b3414031c7c Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期三, 11 二月 2026 11:03:58 +0800
Subject: [PATCH] 小游戏适配 资源系统改造

---
 Main/System/HeroUI/HeroConnectionHeadCell.cs |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/Main/System/HeroUI/HeroConnectionHeadCell.cs b/Main/System/HeroUI/HeroConnectionHeadCell.cs
index 77de465..498a80a 100644
--- a/Main/System/HeroUI/HeroConnectionHeadCell.cs
+++ b/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);
+    }
 }
 

--
Gitblit v1.8.0