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/Main/MainWin.cs |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/Main/System/Main/MainWin.cs b/Main/System/Main/MainWin.cs
index 5177284..3ed2f14 100644
--- a/Main/System/Main/MainWin.cs
+++ b/Main/System/Main/MainWin.cs
@@ -1,8 +1,9 @@
-using System;
+锘縰sing System;
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UI;
+using Cysharp.Threading.Tasks;
 
 /// <summary>
 /// 娓告垙涓荤晫闈㈠簳閮ㄥ姛鑳芥寜閽�
@@ -295,7 +296,7 @@
     /// <summary>
     /// 鏍规嵁鏍囩绱㈠紩鎵撳紑瀵瑰簲鐨勫瓙鐣岄潰
     /// </summary>
-    protected override void OpenSubUIByTabIndex()
+    protected override async void OpenSubUIByTabIndex()
     {
 
         Debug.Log("鎵撳紑瀛愮晫闈� : " + functionOrder);
@@ -307,18 +308,18 @@
                 // 鎵撳紑涓婚〉鐣岄潰
                 if (!UIManager.Instance.IsOpened<BattleWin>())
                 {
-                    UIManager.Instance.OpenWindowAsync<BattleWin>().ContinueWith(battleWin =>
-                        battleWin.SetBattleField(BattleManager.Instance.storyBattleField)).Forget();
+                    BattleWin battleWin = await UIManager.Instance.OpenWindowAsync<BattleWin>();
+                    battleWin.SetBattleField(BattleManager.Instance.storyBattleField);
                 }
                 else
                 {
                     BattleWin battleWin = UIManager.Instance.GetUI<BattleWin>();
                     battleWin.SetBattleField(BattleManager.Instance.storyBattleField);
                 }
-                UIManager.Instance.OpenWindowAsync<HomeWin>().ContinueWith(w => currentSubUI = w).Forget();
+                currentSubUI = await UIManager.Instance.OpenWindowAsync<HomeWin>();
                 break;
             case 1:
-                UIManager.Instance.OpenWindowAsync<AffairBaseWin>().ContinueWith(w => currentSubUI = w).Forget();
+                currentSubUI = await UIManager.Instance.OpenWindowAsync<AffairBaseWin>();
                 break;
             case 2:
                 if (gameTip.gameObject.activeSelf)
@@ -328,14 +329,14 @@
                         HappyXBModel.Instance.startTenCallGuide = true;
                     }
                 }
-                UIManager.Instance.OpenWindowAsync<HeroBaseWin>(0).ContinueWith(w => currentSubUI = w).Forget();
+                currentSubUI = await UIManager.Instance.OpenWindowAsync<HeroBaseWin>(0);
                 break;
             // case 3:
             //     鎸戞垬鐣岄潰涓嶈烦杞�
             //     Debug.Log("鎵撳紑鎸戞垬鐣岄潰");
             //     break;
             case 4:
-                UIManager.Instance.OpenWindowAsync<GuildBaseWin>().ContinueWith(w => currentSubUI = w).Forget();
+                currentSubUI = await UIManager.Instance.OpenWindowAsync<GuildBaseWin>();
                 break;
             default:
                 Debug.LogWarning("鏈煡鐨勬爣绛剧储寮�: " + functionOrder);
@@ -471,7 +472,7 @@
     {
         if (nextCantAttackMask.localScale == Vector3.one)
         {
-            if (BattleManager.Instance.storyBattleField.IsCanRequestFight())
+            if (BattleManager.Instance.storyBattleField != null && BattleManager.Instance.storyBattleField.IsCanRequestFight())
             {
                 nextCantAttackMask.localScale = Vector3.zero;
             }

--
Gitblit v1.8.0