yyl
2026-03-04 bc1cb6da854cb2e9144f10ed55330a537ecdca16
Main/System/HeroUI/HeroShowBaseCell.cs
@@ -1,6 +1,7 @@
using UnityEngine;
using UnityEngine.UI;
using System.Collections.Generic;
using Cysharp.Threading.Tasks;
//武将模型站台模块
public class HeroShowBaseCell : MonoBehaviour
@@ -133,13 +134,13 @@
    void Awake()
    {
        LoadPrefab();
        LoadPrefab().Forget();
    }
    // 武将模型站台显示
    public void Init(int heroID, int skinID, int breakLevel = 0, int star = 0, int awakelv = 0, int lv = 0, bool isShowLock = false)
    public async void Init(int heroID, int skinID, int breakLevel = 0, int star = 0, int awakelv = 0, int lv = 0, bool isShowLock = false)
    {
        LoadPrefab();   //存在被卸载的可能,重新加载
        await LoadPrefab();   //存在被卸载的可能,重新加载
        var heroConfig = HeroConfig.Get(heroID);
        qualityBG.SetSprite("herodz" + heroConfig.Quality);
        // int skinID = 0;
@@ -153,7 +154,7 @@
        //     skinID = heroConfig.SkinIDList[0];
        // }
        heroModel.Create(skinID, heroConfig.UIScale);
        heroModel.Create(skinID, heroConfig.UIScale).Forget();
        if (star == 0)
        {
@@ -202,12 +203,12 @@
        { 
            SmallTipWin.showText = Language.Get("HeroGift14", star);
            SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition);
            UIManager.Instance.OpenWindow<SmallTipWin>();
            UIManager.Instance.OpenWindowAsync<SmallTipWin>().Forget();
        });
    }
    GameObject cellContainer;
    protected void LoadPrefab()
    protected async UniTask LoadPrefab()
    {
        if (cellContainer != null)
            return;
@@ -220,7 +221,16 @@
        }
        if (cellContainer == null)
        {
            cellContainer = UIUtility.CreateWidget("HeroShowBaseCell", "Container_HeroShow");
            cellContainer = await UIUtility.CreateWidget("HeroShowBaseCell", "Container_HeroShow");
            if (this == null)
            {
                if (cellContainer != null)
                {
                    DestroyImmediate(cellContainer);
                    return;
                }
            }
            if (cellContainer != null)
            {