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/HeroUI/HeroShowBaseCell.cs | 24 +++++++++++++++++-------
1 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/Main/System/HeroUI/HeroShowBaseCell.cs b/Main/System/HeroUI/HeroShowBaseCell.cs
index 6d89639..84b1c13 100644
--- a/Main/System/HeroUI/HeroShowBaseCell.cs
+++ b/Main/System/HeroUI/HeroShowBaseCell.cs
@@ -1,6 +1,7 @@
锘縰sing 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)
{
--
Gitblit v1.8.0