From f71b5c3c7cead38ef428d058c7145ac461bdd92d 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, 22 Oct 2025 16:25:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Runtime/UXComponent/UXUIAnimation.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Runtime/UXComponent/UXUIAnimation.cs b/Runtime/UXComponent/UXUIAnimation.cs index 2f95731..26651cd 100644 --- a/Runtime/UXComponent/UXUIAnimation.cs +++ b/Runtime/UXComponent/UXUIAnimation.cs @@ -17,6 +17,9 @@ namespace AlicizaX.UI.Extension.UXComponent [LabelText("关闭动画")] [BoxGroup("基础设置", true)] [ValueDropdown("GetAllAnimationClips", ExpandAllMenuItems = true)] [SerializeField] private string HideAnimationName; + [LabelText("关闭动画")] [BoxGroup("基础设置", true)] [ValueDropdown("GetAllAnimationClips", ExpandAllMenuItems = true)] [SerializeField] + private string InitAnimationName; + private UIHolderObjectBase _holderObjectBase; #if UNITY_EDITOR public List GetAllAnimationClips @@ -43,14 +46,24 @@ namespace AlicizaX.UI.Extension.UXComponent _holderObjectBase = GetComponent(); _holderObjectBase.OnWindowShowEvent += ShowAnimation; _holderObjectBase.OnWindowClosedEvent += CloseAnimation; + _holderObjectBase.OnWindowInitEvent += InitAnimation; } private void OnDestroy() { + _holderObjectBase.OnWindowInitEvent -= InitAnimation; _holderObjectBase.OnWindowShowEvent -= ShowAnimation; _holderObjectBase.OnWindowClosedEvent -= CloseAnimation; } + private void InitAnimation() + { + if (!string.IsNullOrEmpty(InitAnimationName)) + { + animationFlow.Play(InitAnimationName); + } + } + internal void ShowAnimation() { animationFlow.Play(ShowAnimationName);