From cb893e1e5e4820cb800836cf6b8a79a1cd986cdc Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 22 Jul 2021 18:34:47 +0800 Subject: *misc --- Assets/ActionTool/Editor/ActionData.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Assets/ActionTool/Editor/ActionData.cs') diff --git a/Assets/ActionTool/Editor/ActionData.cs b/Assets/ActionTool/Editor/ActionData.cs index c00dd269..77935f68 100644 --- a/Assets/ActionTool/Editor/ActionData.cs +++ b/Assets/ActionTool/Editor/ActionData.cs @@ -20,6 +20,8 @@ namespace ActionTool private AnimationEventBase m_CurEventInfo; // 当前正在编辑的event + private TimelineEvent m_Timeline; + #region metadata private float m_TotalFrame; //timeline采样的总帧数 public float totalFrame { get { return m_TotalFrame; } } @@ -64,6 +66,7 @@ namespace ActionTool m_PrevLocalTime = 0; m_Animator.Play(kStateName, 0, 0); m_RootMotion = rootmotion; + m_Timeline = m_Animator.gameObject.GetComponent(); } public void SetCurrentAnimTime(float time) @@ -180,7 +183,9 @@ namespace ActionTool } public void RunEvent() - { + { + if (m_Timeline != null) + m_Timeline.ExecuteAnimationEvents(ActionManager.animationData, m_CurAnimFrame); } public void CreateEvent(TimelineEvent.EEventType eventtype, int startFrame) @@ -202,7 +207,7 @@ namespace ActionTool if(type != null) { var e = Activator.CreateInstance(type) as AnimationEventBase; - e.type = eventtype; + //e.type = eventtype; e.startFrame = startFrame; AddEvent(e); } -- cgit v1.1-26-g67d0