Skip to content

Commit 55c602c

Browse files
committed
feat(FUI): 添加界面显示和隐藏方法
实现界面显示和隐藏的动画处理逻辑,支持自定义处理接口和完成回调
1 parent db4186c commit 55c602c

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

Runtime/FUI.cs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,40 @@ public class FUI : UIForm
4848
/// </summary>
4949
public Action<bool> OnVisibleChanged { get; set; }
5050

51+
/// <summary>
52+
/// 界面显示。
53+
/// </summary>
54+
/// <param name="handler">界面显示处理接口</param>
55+
/// <param name="complete">完成回调</param>
56+
public override void Show(IUIFormShowHandler handler, Action complete)
57+
{
58+
if (handler != null)
59+
{
60+
handler.Handler(GObject, EnableShowAnimation, ShowAnimationName, complete);
61+
}
62+
else
63+
{
64+
complete?.Invoke();
65+
}
66+
}
67+
68+
/// <summary>
69+
/// 界面隐藏。
70+
/// </summary>
71+
/// <param name="handler">界面隐藏处理接口</param>
72+
/// <param name="complete">完成回调</param>
73+
public override void Hide(IUIFormHideHandler handler, Action complete)
74+
{
75+
if (handler != null)
76+
{
77+
handler.Handler(GObject, EnableHideAnimation, HideAnimationName, complete);
78+
}
79+
else
80+
{
81+
complete?.Invoke();
82+
}
83+
}
84+
5185
/// <summary>
5286
/// 设置UI的显示状态,不发出事件
5387
/// </summary>

0 commit comments

Comments
 (0)