From e471ff18d7f8276765cef1ea0906f667b0548355 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期三, 04 十二月 2024 18:12:12 +0800
Subject: [PATCH] 0312 修复聊天浮窗 真机报错问题

---
 System/WindowBase/WindowCenter.cs |   50 +++++++++++++++++++++++++-------------------------
 1 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/System/WindowBase/WindowCenter.cs b/System/WindowBase/WindowCenter.cs
index d115c39..b0404ce 100644
--- a/System/WindowBase/WindowCenter.cs
+++ b/System/WindowBase/WindowCenter.cs
@@ -504,6 +504,7 @@
 
         internal void NotifyAfterOpen<T>(T window) where T : Window
         {
+            CalcMainInterfaceWin();
             if (windowAfterOpenEvent != null)
             {
                 windowAfterOpenEvent(window);
@@ -528,6 +529,7 @@
 
         internal void JumpNotifyAfterClose<T>(T window) where T : Window
         {
+            CalcMainInterfaceWin();
             if (jumpWindowCloseEvent != null)
             {
                 jumpWindowCloseEvent(window);
@@ -579,7 +581,6 @@
         float checkTimer = 0f;
         private void LateUpdate()
         {
-            var checkMainWinImmedidately = closeCommands.Count + openCommands.Count > 0;
             while (closeCommands.Count > 0)
             {
                 var command = closeCommands[0];
@@ -621,39 +622,38 @@
                 }
 
             }
+        }
 
-            checkTimer += checkMainWinImmedidately ? 1f : Time.deltaTime;
-            if (checkTimer > 0.5f)
+        //涓荤晫闈㈢殑寮�鍏抽粯璁ゅ鐞�
+        void CalcMainInterfaceWin()
+        {
+            if (!StageLoad.Instance.isLoading)
             {
-                checkTimer = 0f;
-                if (!StageLoad.Instance.isLoading)
-                {
-                    var exceptOpen = StageLoad.Instance.stageType == Stage.E_StageType.Dungeon
-                        && !ExistAnyFullScreenOrMaskWinLEqual(WindowType.Base)
-                        && !IsOpen("DefaultDialogueBoxWin")
-                        && !IsOpen("DialogueDuidanceWin")
-                        && !IsOpen("TaskBoxBGMWin")
-                        && !IsOpen("WelcomeWin")
-                        && !IsOpen("HazyRegionDialogueWin")
-                        && !IsOpen("NormalDialogueWin")
-                        && !IsOpen("GuideDialogueWin");
+                var exceptOpen = StageLoad.Instance.stageType == Stage.E_StageType.Dungeon
+                    && !ExistAnyFullScreenOrMaskWinLEqual(WindowType.Base)
+                    && !IsOpen("DefaultDialogueBoxWin")
+                    && !IsOpen("DialogueDuidanceWin")
+                    && !IsOpen("TaskBoxBGMWin")
+                    && !IsOpen("WelcomeWin")
+                    && !IsOpen("HazyRegionDialogueWin")
+                    && !IsOpen("NormalDialogueWin")
+                    && !IsOpen("GuideDialogueWin");
 
-                    if (exceptOpen != IsOpen("MainInterfaceWin") && windows.ContainsKey("MainInterfaceWin"))
+                if (exceptOpen != IsOpen("MainInterfaceWin") && windows.ContainsKey("MainInterfaceWin"))
+                {
+                    if (exceptOpen)
                     {
-                        if (exceptOpen)
-                        {
-                            windows["MainInterfaceWin"].Open();
-                        }
-                        else
-                        {
-                            windows["MainInterfaceWin"].CloseImmediately();
-                        }
+                        windows["MainInterfaceWin"].Open();
+                    }
+                    else
+                    {
+                        windows["MainInterfaceWin"].CloseImmediately();
                     }
                 }
             }
-
         }
 
+
         private void ExecuteFirstOpen(OpenCommand command)
         {
             GetWindowPrefab(command, (bool ok, GameObject prefab) =>

--
Gitblit v1.8.0