修改
This commit is contained in:
parent
2ffaf6e1bf
commit
f71b5c3c7c
@ -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<string> GetAllAnimationClips
|
||||
@ -43,14 +46,24 @@ namespace AlicizaX.UI.Extension.UXComponent
|
||||
_holderObjectBase = GetComponent<UIHolderObjectBase>();
|
||||
_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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user