This commit is contained in:
陈思海 2025-09-25 19:28:20 +08:00
parent f42f4df718
commit a5c92a0f69
2 changed files with 11 additions and 17 deletions

View File

@ -212,12 +212,15 @@ namespace AlicizaX.UI.Runtime
}
internal async UniTask InternalOpen()
{
if (_state != UIState.Opened)
{
_state = UIState.Opened;
Visible = true;
Holder.OnWindowShowEvent?.Invoke();
await OnOpenAsync();
}
}
internal async UniTask InternalClose()
{

View File

@ -17,17 +17,14 @@ namespace AlicizaX.UI.Runtime
public Action OnWindowClosedEvent;
public Action OnWindowDestroyEvent;
#if UNITY_EDITOR && ALICIZAX_UI_ANIMATION_SUPPORT
private void SetAnimtionFlow()
{
// 编辑器模式下自动重置状态
AnimationFlow = GetComponent<AnimationFlow.Runtime.AnimationFlow>();
}
#endif
#if ALICIZAX_UI_ANIMATION_SUPPORT
public async UniTask PlayAnimtion(string name)
{
if (AnimationFlow == null)
{
AnimationFlow = transform.GetComponent<AnimationFlow.Runtime.AnimationFlow>();
}
await AnimationFlow.PlayAsync(name);
}
#endif
@ -58,13 +55,7 @@ namespace AlicizaX.UI.Runtime
internal set { _target.SetActive(value); }
}
#if UNITY_EDITOR && ALICIZAX_UI_ANIMATION_SUPPORT
[InlineButton("SetAnimtionFlow")]
#endif
#if ALICIZAX_UI_ANIMATION_SUPPORT
[SerializeField]
[HideLabel]
private AnimationFlow.Runtime.AnimationFlow AnimationFlow;
#endif