yyl
2026-03-04 bc1cb6da854cb2e9144f10ed55330a537ecdca16
Main/System/SkillUI/SkillWordCell.cs
@@ -1,6 +1,7 @@
using 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)
            {