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/Battle/UIComp/BattleBuffCell.cs |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/Main/System/Battle/UIComp/BattleBuffCell.cs b/Main/System/Battle/UIComp/BattleBuffCell.cs
index 5376f81..90e2946 100644
--- a/Main/System/Battle/UIComp/BattleBuffCell.cs
+++ b/Main/System/Battle/UIComp/BattleBuffCell.cs
@@ -1,6 +1,7 @@
 using UnityEngine;
 using UnityEngine.UI;
 using System;
+using Cysharp.Threading.Tasks;
 
 public class BattleBuffCell : MonoBehaviour
 {
@@ -51,7 +52,7 @@
 
     GameObject cellContainer;
 
-    private void LoadPrefab()
+    private async UniTask LoadPrefab()
     {
         if (cellContainer != null)
             return;
@@ -65,7 +66,16 @@
 
         if (cellContainer == null)
         {
-            cellContainer = UIUtility.CreateWidget("BattleBuffCell", "Container_BuffCell");
+            cellContainer = await UIUtility.CreateWidget("BattleBuffCell", "Container_BuffCell");
+            if (this == null)
+            {
+                if (null != cellContainer)
+                {
+                    DestroyImmediate(cellContainer);
+                }
+                return;
+            }
+
             if (cellContainer != null)
             {
                 cellContainer.transform.SetParentEx(this.transform, Vector3.zero, Quaternion.identity, Vector3.one);
@@ -92,13 +102,13 @@
         // cellContainer.transform.localScale = cellContainer.transform.localScale * scale;
     }
 
-    public void Init(HB428_tagSCBuffRefresh buffData, Action onclick = null, bool showType = false)
+    public async UniTask Init(HB428_tagSCBuffRefresh buffData, Action onclick = null, bool showType = false)
     {
         if (null == buffData || gameObject == null)
         {
             return;
         }
-        LoadPrefab();   //瀛樺湪琚嵏杞界殑鍙兘锛岄噸鏂板姞杞�
+        await LoadPrefab();   //瀛樺湪琚嵏杞界殑鍙兘锛岄噸鏂板姞杞�
         var config = SkillConfig.Get((int)buffData.SkillID);
         if (config == null)
         {

--
Gitblit v1.8.0