This commit is contained in:
ALEXTANGXIAO
2024-09-20 22:43:08 +08:00
parent 3ac6977f93
commit 4b178a9fa9
2 changed files with 9 additions and 5 deletions

View File

@@ -101,7 +101,7 @@ namespace TEngine
_errorLogger.Dispose(); _errorLogger.Dispose();
_errorLogger = null; _errorLogger = null;
} }
CloseAll(); CloseAll(isShutDown:true);
if (m_InstanceRoot != null && m_InstanceRoot.parent != null) if (m_InstanceRoot != null && m_InstanceRoot.parent != null)
{ {
Destroy(m_InstanceRoot.parent.gameObject); Destroy(m_InstanceRoot.parent.gameObject);
@@ -393,12 +393,12 @@ namespace TEngine
/// <summary> /// <summary>
/// 关闭所有窗口。 /// 关闭所有窗口。
/// </summary> /// </summary>
public void CloseAll() public void CloseAll(bool isShutDown = false)
{ {
for (int i = 0; i < _stack.Count; i++) for (int i = 0; i < _stack.Count; i++)
{ {
UIWindow window = _stack[i]; UIWindow window = _stack[i];
window.InternalDestroy(); window.InternalDestroy(isShutDown);
} }
_stack.Clear(); _stack.Clear();

View File

@@ -370,7 +370,7 @@ namespace TEngine
return needUpdate; return needUpdate;
} }
internal void InternalDestroy() internal void InternalDestroy(bool isShutDown = false)
{ {
_isCreate = false; _isCreate = false;
@@ -394,7 +394,11 @@ namespace TEngine
Object.Destroy(_panel); Object.Destroy(_panel);
_panel = null; _panel = null;
} }
CancelHideToCloseTimer();
if (!isShutDown)
{
CancelHideToCloseTimer();
}
} }
/// <summary> /// <summary>