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/MinggeBuffCell.cs | 22 ++++++++++++++++++----
1 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/Main/System/Battle/UIComp/MinggeBuffCell.cs b/Main/System/Battle/UIComp/MinggeBuffCell.cs
index bd49b47..56454ca 100644
--- a/Main/System/Battle/UIComp/MinggeBuffCell.cs
+++ b/Main/System/Battle/UIComp/MinggeBuffCell.cs
@@ -1,6 +1,7 @@
using UnityEngine;
using UnityEngine.UI;
using System;
+using Cysharp.Threading.Tasks;
public class MinggeBuffCell : MonoBehaviour
{
@@ -51,7 +52,7 @@
GameObject cellContainer;
- private void LoadPrefab()
+ private async UniTask LoadPrefab()
{
if (cellContainer != null)
return;
@@ -65,7 +66,15 @@
if (cellContainer == null)
{
- cellContainer = UIUtility.CreateWidget("MinggeBuffCell", "Container_BuffCell");
+ cellContainer = await UIUtility.CreateWidget("MinggeBuffCell", "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 +101,18 @@
// 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(); //瀛樺湪琚嵏杞界殑鍙兘锛岄噸鏂板姞杞�
+ if (null == this || cellContainer == null)
+ {
+ return;
+ }
+
var config = SkillConfig.Get((int)buffData.SkillID);
if (config == null)
{
--
Gitblit v1.8.0