From 5ea3821b3fde03c81970bd32bf8c25994cd4c6b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=80=9D=E6=B5=B7?= <1464576565@qq.com> Date: Thu, 25 Sep 2025 19:26:15 +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 | 29 ++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/Runtime/UXComponent/UXUIAnimation.cs b/Runtime/UXComponent/UXUIAnimation.cs index e837796..2f95731 100644 --- a/Runtime/UXComponent/UXUIAnimation.cs +++ b/Runtime/UXComponent/UXUIAnimation.cs @@ -1,5 +1,7 @@ using System; +using System.Collections.Generic; using AlicizaX.UI.Runtime; +using Sirenix.OdinInspector; using UnityEngine; namespace AlicizaX.UI.Extension.UXComponent @@ -7,11 +9,30 @@ namespace AlicizaX.UI.Extension.UXComponent [RequireComponent(typeof(AnimationFlow.Runtime.AnimationFlow))] public class UXUIAnimation : MonoBehaviour { - [SerializeField] private AnimationFlow.Runtime.AnimationFlow animationFlow; - [SerializeField] private string ShowAnimationName = "Show"; - [SerializeField] private string HideAnimationName = "Close"; - private UIHolderObjectBase _holderObjectBase; + [ReadOnly] [SerializeField] private AnimationFlow.Runtime.AnimationFlow animationFlow; + [LabelText("显示动画")] [BoxGroup("基础设置", true)] [ValueDropdown("GetAllAnimationClips", ExpandAllMenuItems = true)] [SerializeField] + private string ShowAnimationName; + + [LabelText("关闭动画")] [BoxGroup("基础设置", true)] [ValueDropdown("GetAllAnimationClips", ExpandAllMenuItems = true)] [SerializeField] + private string HideAnimationName; + + private UIHolderObjectBase _holderObjectBase; +#if UNITY_EDITOR + public List GetAllAnimationClips + { + get + { + if (animationFlow == null) + { + animationFlow = GetComponent(); + } + + return animationFlow.GetAllAnimationClips; + } + } + +#endif private void OnValidate() { animationFlow = GetComponent();