From 1ab047b5fdd933c38ba0519ec2e83a44512ea8d7 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期四, 26 三月 2026 17:46:11 +0800
Subject: [PATCH] webgl代码合并 1

---
 Main/System/HeroUI/HeroPosWin.cs |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/Main/System/HeroUI/HeroPosWin.cs b/Main/System/HeroUI/HeroPosWin.cs
index 7bb4492..88ba5aa 100644
--- a/Main/System/HeroUI/HeroPosWin.cs
+++ b/Main/System/HeroUI/HeroPosWin.cs
@@ -43,6 +43,8 @@
     [SerializeField] Transform caseesObj;
     FuncPresetChooseCells presetChooseCells;
 
+    Action presetChooseCellssetOnLoaded;
+
     [SerializeField] Button funPresetBtn;
 
 
@@ -107,6 +109,8 @@
             presetObj.transform.SetParentEx(caseesObj, Vector3.zero, Quaternion.identity, Vector3.one);
             presetChooseCells = presetObj.GetComponent<FuncPresetChooseCells>();
             presetChooseCells.ChangeAlignment(TextAnchor.MiddleCenter);
+            presetChooseCellssetOnLoaded?.Invoke();
+            presetChooseCellssetOnLoaded = null;
         }).Forget();
 
 
@@ -199,7 +203,20 @@
         }
         fightPowerText.text = UIHelper.ReplaceLargeArtNum(FightPowerManager.Instance.GetTeamFightPower(HeroUIManager.Instance.selectTeamType, true));
 
-        presetChooseCells.Display((int)BattlePreSetType.Story, (int)FuncPresetType.Team);
+        if (null == presetChooseCells)
+        {
+            presetChooseCellssetOnLoaded = () =>
+            {
+                if (this == null)
+                    return;
+                presetChooseCells.Display((int)BattlePreSetType.Story, (int)FuncPresetType.Team);
+            };
+        }
+        else
+        {
+            presetChooseCells.Display((int)BattlePreSetType.Story, (int)FuncPresetType.Team);
+        }
+
 
         funPresetBtn.SetActive(FuncPresetManager.Instance.IsPreShow());
     }
@@ -382,7 +399,7 @@
 
 
             flyAlphaTween.alpha = 1;
-            flyHead.Init(flyHero.heroId, flyHero.SkinID);
+            flyHead.Init(flyHero.heroId, flyHero.SkinID).Forget();
             flyHead.transform.position = startPos;
             var targetPos = scenePosImgs[posList[0]].transform.position;
             flyHead.transform.localScale = Vector3.one;

--
Gitblit v1.8.0