yyl
2026-03-04 bc1cb6da854cb2e9144f10ed55330a537ecdca16
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)
        {