From 494d3f727786ff70753692d8de019d9600a007e1 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 3 Aug 2021 19:33:43 +0800 Subject: *misc --- Assets/ActionTool/Editor/ActionColliderFrameEditor.cs | 4 ++-- Assets/ActionTool/Editor/ActionData.cs | 6 +++--- Assets/ActionTool/Editor/ActionManager.cs | 4 ++-- Assets/ActionTool/Editor/ActionPreviewEditor.cs | 4 ++-- Assets/ActionTool/Editor/ActionToolSettingsEditor.cs | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) (limited to 'Assets/ActionTool/Editor') diff --git a/Assets/ActionTool/Editor/ActionColliderFrameEditor.cs b/Assets/ActionTool/Editor/ActionColliderFrameEditor.cs index 91b6d0c3..4efd1f93 100644 --- a/Assets/ActionTool/Editor/ActionColliderFrameEditor.cs +++ b/Assets/ActionTool/Editor/ActionColliderFrameEditor.cs @@ -68,14 +68,14 @@ namespace ActionTool { ActionData action = ActionManager.actionData; float normaltime = frame.frame / action.totalFrame; - action.curAnimTimeNormal = normaltime - 0.01f; + action.curAnimTimeNormal = normaltime - 0.001f; } if (GUILayout.Button("Right abit")) { ActionData action = ActionManager.actionData; float normaltime = frame.frame / action.totalFrame; - action.curAnimTimeNormal = normaltime + 0.01f; + action.curAnimTimeNormal = normaltime + 0.001f; } if (GUILayout.Button("Current")) diff --git a/Assets/ActionTool/Editor/ActionData.cs b/Assets/ActionTool/Editor/ActionData.cs index 6116442c..cd76ba8d 100644 --- a/Assets/ActionTool/Editor/ActionData.cs +++ b/Assets/ActionTool/Editor/ActionData.cs @@ -20,7 +20,7 @@ namespace ActionTool private AnimationEventBase m_CurEventInfo; // 当前正在编辑的event - private TimelineEvent m_Timeline; + private UnitTimeline m_Timeline; #region metadata private float m_TotalFrame; //timeline采样的总帧数 @@ -67,7 +67,7 @@ namespace ActionTool m_PrevLocalTime = 0; m_Animator.Play(kStateName, 0, 0); m_RootMotion = rootmotion; - m_Timeline = m_Animator.gameObject.GetComponent(); + m_Timeline = m_Animator.gameObject.GetOrAddComponent(); } public void SetCurrentAnimTime(float time) @@ -196,7 +196,7 @@ namespace ActionTool m_Timeline.ExecuteAnimationEvents(ActionManager.animationData, m_CurAnimFrame); } - public void CreateEvent(TimelineEvent.EEventType eventtype, int startFrame) + public void CreateEvent(UnitTimeline.EEventType eventtype, int startFrame) { var classes = Assembly .GetAssembly(typeof(AnimationEventBase)) diff --git a/Assets/ActionTool/Editor/ActionManager.cs b/Assets/ActionTool/Editor/ActionManager.cs index feefde88..b39dec61 100644 --- a/Assets/ActionTool/Editor/ActionManager.cs +++ b/Assets/ActionTool/Editor/ActionManager.cs @@ -425,7 +425,7 @@ namespace ActionTool public static void AddNewEvent(object param) { EventParam eventParam = (EventParam )param; - string eventName = eventParam.eventName; // TimelineEvent.EEventType + string eventName = eventParam.eventName; // UnitTimeline.EEventType int frame = eventParam.frame; Debug.Log("[ActionTool] Add new event " + eventName); if (animationData == null) @@ -433,7 +433,7 @@ namespace ActionTool Debug.LogError("[ActionTool] 没有animation data数据"); return; } - Type type = TimelineEvent.GetTypeByName(eventName); + Type type = UnitTimeline.GetTypeByName(eventName); if(type == null) { Debug.LogError("[ActionTool] 没有创建对应的类, " + eventName); diff --git a/Assets/ActionTool/Editor/ActionPreviewEditor.cs b/Assets/ActionTool/Editor/ActionPreviewEditor.cs index 8b13b70a..bbf74743 100644 --- a/Assets/ActionTool/Editor/ActionPreviewEditor.cs +++ b/Assets/ActionTool/Editor/ActionPreviewEditor.cs @@ -638,7 +638,7 @@ namespace ActionTool ActionData action = ActionManager.actionData; Vector2 position = Event.current.mousePosition; - Rect eventRegion = new Rect(kTimeLineViewXOffset, m_GridY, action.totalFrame * kFrameWidth, TimelineEvent.kMaxEventsPerFrame * kFrameHeight); + Rect eventRegion = new Rect(kTimeLineViewXOffset, m_GridY, action.totalFrame * kFrameWidth, UnitTimeline.kMaxEventsPerFrame * kFrameHeight); if (!eventRegion.Contains(position)) return; @@ -646,7 +646,7 @@ namespace ActionTool int frame = (int)(pos.x / kFrameWidth); GenericMenu eventMenu = new GenericMenu(); - foreach(var name in Enum.GetNames(typeof(TimelineEvent.EEventType))) + foreach(var name in Enum.GetNames(typeof(UnitTimeline.EEventType))) { GUIContent item = null; string shortName = name.Replace("Event", ""); diff --git a/Assets/ActionTool/Editor/ActionToolSettingsEditor.cs b/Assets/ActionTool/Editor/ActionToolSettingsEditor.cs index ee73f844..2afde647 100644 --- a/Assets/ActionTool/Editor/ActionToolSettingsEditor.cs +++ b/Assets/ActionTool/Editor/ActionToolSettingsEditor.cs @@ -35,7 +35,7 @@ public class ActionToolSettingsEditor : Editor EditorGUI.BeginChangeCheck(); - foreach (var name in Enum.GetNames(typeof(TimelineEvent.EEventType))) + foreach (var name in Enum.GetNames(typeof(UnitTimeline.EEventType))) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(name); -- cgit v1.1-26-g67d0