Main/UI/UIManager.cs
@@ -54,6 +54,10 @@ // 检查间隔(秒) private const float CHECK_INTERVAL = 5f; public Action<UIBase> OnOpenWindow; public Action<UIBase> OnCloseWindow; #endregion #region 初始化 @@ -517,6 +521,8 @@ // 打开UI ui.HandleOpen(); OnOpenWindow?.Invoke(ui); // 检查并关闭长时间未使用的UI CheckAndCloseIdleUI(); @@ -617,6 +623,7 @@ // 关闭UI ui.HandleClose(); OnCloseWindow?.Invoke(ui); // 销毁UI对象 GameObject.Destroy(ui.gameObject);