From bc1cb6da854cb2e9144f10ed55330a537ecdca16 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期三, 04 三月 2026 14:35:57 +0800
Subject: [PATCH] 466 h5版本 资源规则修改 打包修改(未完成 勿拉取)

---
 Main/System/SkillUI/SkillWordCell.cs |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/Main/System/SkillUI/SkillWordCell.cs b/Main/System/SkillUI/SkillWordCell.cs
index 3658500..fa00e2e 100644
--- a/Main/System/SkillUI/SkillWordCell.cs
+++ b/Main/System/SkillUI/SkillWordCell.cs
@@ -1,6 +1,7 @@
 锘縰sing UnityEngine;
 using UnityEngine.UI;
 using UnityEngine.Events;
+using Cysharp.Threading.Tasks;
 
 public class SkillWordCell : MonoBehaviour
 {
@@ -47,12 +48,12 @@
 
     void Awake()
     {
-        LoadPrefab();
+        LoadPrefab().Forget();
     }
 
-    public void Init(int skillID, UnityAction onclick = null, bool showType = false)
+    public async UniTask Init(int skillID, UnityAction onclick = null, bool showType = false)
     {
-        LoadPrefab();   //瀛樺湪琚嵏杞界殑鍙兘锛岄噸鏂板姞杞�
+        await LoadPrefab();   //瀛樺湪琚嵏杞界殑鍙兘锛岄噸鏂板姞杞�
         var config = SkillConfig.Get(skillID);
         if (config == null)
         {
@@ -77,7 +78,7 @@
     }
 
     GameObject cellContainer;
-    protected void LoadPrefab()
+    protected async UniTask LoadPrefab()
     {
         if (cellContainer != null)
             return;
@@ -90,7 +91,16 @@
         }
         if (cellContainer == null)
         {
-            cellContainer = UIUtility.CreateWidget("SkillWordCell", "Container_SkillCell");
+            cellContainer = await UIUtility.CreateWidget("SkillWordCell", "Container_SkillCell");
+
+            if (this == null)
+            {
+                if (null != cellContainer)
+                {
+                    DestroyImmediate(cellContainer);
+                }
+                return;
+            }
 
             if (cellContainer != null)
             {

--
Gitblit v1.8.0