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

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

diff --git a/Main/System/HeroUI/HeroHeadBaseNoTrainCell.cs b/Main/System/HeroUI/HeroHeadBaseNoTrainCell.cs
index 3126d22..5168d96 100644
--- a/Main/System/HeroUI/HeroHeadBaseNoTrainCell.cs
+++ b/Main/System/HeroUI/HeroHeadBaseNoTrainCell.cs
@@ -2,6 +2,7 @@
 using UnityEngine.UI;
 using UnityEngine.Events;
 using System.Collections.Generic;
+using Cysharp.Threading.Tasks;
 
 public class HeroHeadBaseNoTrainCell : MonoBehaviour
 {
@@ -111,6 +112,26 @@
 
     }
 
+    public async UniTask InitAsync(int heroID, bool _gray = false, UnityAction onclick = null)
+    {
+        LoadPrefab();   //瀛樺湪琚嵏杞界殑鍙兘锛岄噸鏂板姞杞�
+        clickBtn.AddListener(onclick);
+        var heroConfig = HeroConfig.Get(heroID);
+        qualityBG.SetSprite("heroheadBG" + heroConfig.Quality);
+
+        var sprite = await UILoader.LoadSpriteAsync("HeroHead", HeroSkinConfig.Get(heroConfig.SkinIDList[0]).SquareIcon);
+        if (this == null) return;
+        heroIcon.overrideSprite = sprite;
+        heroIcon.gray = _gray;
+        qualityBG.gray = _gray;
+
+        countryImg.SetSprite(HeroUIManager.Instance.GetCountryIconName(heroConfig.Country));
+        jobImg.SetSprite(HeroUIManager.Instance.GetJobIconName(heroConfig.Class));
+        nameText.text = heroConfig.Name;
+
+
+    }
+
     GameObject cellContainer;
     protected void LoadPrefab()
     {

--
Gitblit v1.8.0