From 03c0fe672321abb77b613dbe1883926011d064c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=80=9D=E6=B5=B7?= <1464576565@qq.com> Date: Wed, 17 Dec 2025 14:32:03 +0800 Subject: [PATCH] fix --- Runtime/UI/UIBase/UIBase.cs | 6 ++++-- Runtime/UI/UIBase/UIHolderObjectBase.cs | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Runtime/UI/UIBase/UIBase.cs b/Runtime/UI/UIBase/UIBase.cs index d702b26..0976149 100644 --- a/Runtime/UI/UIBase/UIBase.cs +++ b/Runtime/UI/UIBase/UIBase.cs @@ -217,8 +217,9 @@ namespace AlicizaX.UI.Runtime { _state = UIState.Opened; Visible = true; - Holder.OnWindowShowEvent?.Invoke(); + Holder.OnWindowBeforeShowEvent?.Invoke(); await OnOpenAsync(); + Holder.OnWindowAfterShowEvent?.Invoke(); } } @@ -226,10 +227,11 @@ namespace AlicizaX.UI.Runtime { if (_state == UIState.Opened) { - Holder.OnWindowClosedEvent?.Invoke(); + Holder.OnWindowBeforeClosedEvent?.Invoke(); await OnCloseAsync(); _state = UIState.Closed; Visible = false; + Holder.OnWindowAfterClosedEvent?.Invoke(); } } diff --git a/Runtime/UI/UIBase/UIHolderObjectBase.cs b/Runtime/UI/UIBase/UIHolderObjectBase.cs index 6a553df..c94effd 100644 --- a/Runtime/UI/UIBase/UIHolderObjectBase.cs +++ b/Runtime/UI/UIBase/UIHolderObjectBase.cs @@ -8,8 +8,10 @@ namespace AlicizaX.UI.Runtime public abstract class UIHolderObjectBase : UnityEngine.MonoBehaviour { public Action OnWindowInitEvent; - public Action OnWindowShowEvent; - public Action OnWindowClosedEvent; + public Action OnWindowBeforeShowEvent; + public Action OnWindowAfterShowEvent; + public Action OnWindowBeforeClosedEvent; + public Action OnWindowAfterClosedEvent; public Action OnWindowDestroyEvent;