From 542b1b8fe1731f9fd434019663f35b6d5e2e9b44 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期五, 24 十月 2025 12:17:36 +0800
Subject: [PATCH] 0312 优化引导和其他界面冲突问题,优化界面关闭
---
Main/Manager/UIManager.cs | 49 +++++++++++++++++++++++++++++++++++--------------
Main/System/Battle/BattleWin.cs | 2 +-
Main/System/NewBieGuidance/NewBieCenter.cs | 4 +---
3 files changed, 37 insertions(+), 18 deletions(-)
diff --git a/Main/Manager/UIManager.cs b/Main/Manager/UIManager.cs
index c77b59b..748a879 100644
--- a/Main/Manager/UIManager.cs
+++ b/Main/Manager/UIManager.cs
@@ -325,7 +325,7 @@
return false;
}
-
+
// 妫�鏌ユ槸鍚﹀瓨鍦ㄤ换浣曞叏灞忔垨閬僵绐楀彛, 鏆傛湭瀹氫箟鍏ㄥ睆鍙互缁熶竴鍕鹃�塷penMask
public bool ExistAnyFullScreenOrMaskWin(string excludeUIName)
{
@@ -349,6 +349,36 @@
return exist;
}
+
+ //鍦ㄦ鐣岄潰涓婃湁娌′换浣曞叏灞忔垨閬僵绐楀彛
+ public bool ExistAnyFullScreenOrMaskWinAbove(string uiName)
+ {
+ var ui = GetUI(uiName);
+ if (ui == null || !ui.IsActive())
+ {
+ // 濡傛灉UI涓嶅瓨鍦ㄦ垨鏈墦寮�锛岄粯璁や负鏈夎鎸′綇
+ return true;
+ }
+
+ foreach (var uiBase in uiStack)
+ {
+ if (uiBase == null)
+ {
+ continue;
+ }
+ if (uiBase.name == uiName)
+ {
+ break;
+ }
+ if (uiBase.IsActive() && uiBase.openMask)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
// 鑾峰彇鎸囧畾绫诲瀷鐨勬墍鏈塙I瀹炰緥
public List<T> GetAllUI<T>() where T : UIBase
@@ -842,6 +872,10 @@
{
tempStack.Push(tempUI);
}
+ else
+ {
+ break;
+ }
}
// 灏嗕复鏃舵爤涓殑UI閲嶆柊鍘嬪叆鏍堜腑
@@ -926,19 +960,6 @@
}
}
- public void ReturnMainUI()
- {
- List<UIBase> allUI = new List<UIBase>(uiStack);
-
- for (int i = 0; i < allUI.Count; i++)
- {
- UIBase uiBase = allUI[i];
- if (!uiBase.isMainUI && uiBase.uiLayer < UILayer.System)
- {
- CloseWindow(uiBase);
- }
- }
- }
/// <summary>
/// 鍏抽棴鎵�鏈塙I
diff --git a/Main/System/Battle/BattleWin.cs b/Main/System/Battle/BattleWin.cs
index 317c3d3..d6f8fb5 100644
--- a/Main/System/Battle/BattleWin.cs
+++ b/Main/System/Battle/BattleWin.cs
@@ -125,7 +125,7 @@
-
+ // 鏂版墜鏈� 鐜╁鏈仛浠讳綍鎿嶄綔涓嬶紝鍦ㄤ富绾挎垬鏂椾腑鎻愰啋鐐瑰嚮鎴橀敜
void LateUpdate()
{
if (!needGuide)
diff --git a/Main/System/NewBieGuidance/NewBieCenter.cs b/Main/System/NewBieGuidance/NewBieCenter.cs
index 6dae9d9..2a45893 100644
--- a/Main/System/NewBieGuidance/NewBieCenter.cs
+++ b/Main/System/NewBieGuidance/NewBieCenter.cs
@@ -217,9 +217,7 @@
{
var config = GuideConfig.Get(_id);
//瑕佸紩瀵肩殑鐣岄潰涓婃湁鍏朵粬鐣岄潰鐩栦綇锛屽姞鍏ラ槦鍒楃瓑寰呭叾浠栫晫闈㈠叧闂殑鏃跺�欏啀瑙﹀彂璇ョ晫闈㈠紩瀵�
- // if (UIManager.Instance.ExistAnyFullScreenOrMaskWin(config.WinName))
- var ui = UIManager.Instance.GetUI(config.WinName);
- if (ui.IsActive() && ui.childrenUI != null && ui.childrenUI.Count > 0)
+ if (UIManager.Instance.ExistAnyFullScreenOrMaskWinAbove(config.WinName))
{
//濡傛灉瀛愮晫闈㈡槸蹇呴』鎸傚湪璇ョ晫闈笂鍒囦笖娌℃湁钂欑増鐩栦綇鐨勫彲浠ュ鍔犲垽鏂�
if (!waitGuideWinNames.Contains(config.WinName))
--
Gitblit v1.8.0