From 8588ce841de7ab9095e70812edb60a31f4a85f71 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 4 Aug 2021 09:52:03 +0800 Subject: +animation curve --- Assets/ActionTool/Editor/ActionPreviewEditor.cs | 27 ++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'Assets/ActionTool/Editor/ActionPreviewEditor.cs') diff --git a/Assets/ActionTool/Editor/ActionPreviewEditor.cs b/Assets/ActionTool/Editor/ActionPreviewEditor.cs index bbf74743..255df3a2 100644 --- a/Assets/ActionTool/Editor/ActionPreviewEditor.cs +++ b/Assets/ActionTool/Editor/ActionPreviewEditor.cs @@ -40,8 +40,9 @@ namespace ActionTool const float kToolbarControlMargin = 5; const float kToolbarHeight = 50; const float kToolbarControlSize = kToolbarHeight - kToolbarControlMargin * 2; - const float kTimeLineViewXOffset = 20; - const float kTimeLineViewYOffset = 80; + const float kCurveYOffset = 80; + const float kTimeLineViewXOffset = 20; + const float kTimeLineViewYOffset = 110; const float kFrameWidth = 10; const float kFrameHeight = 20; @@ -80,6 +81,12 @@ namespace ActionTool private void OnGUI() { + //if(ActionManager.actionData == null) + //{ + // this.Close(); + // return; + //} + styles = ActionEditorStyles.Get(); if (ActionManager.CurrentAnimationName == null || ActionManager.CurrentAnimationName == "") @@ -93,6 +100,7 @@ namespace ActionTool GUI_Toolbar(); GUI_Detail(); + GUI_Curve(); GUI_TimeLineView(); } @@ -215,7 +223,20 @@ namespace ActionTool x += 200; } - Vector2 scrollPos = Vector2.zero; + void GUI_Curve() + { + AnimationData animData = ActionManager.animationData; + if (animData == null) + return; + + float y = kCurveYOffset; + float x = 5; + GUI.Label(new Rect(x, y, 105, 20), "Speed Curve:"); + x += 105; + animData.curve = EditorGUI.CurveField(new Rect(x, y, 210, 20), animData.curve); + } + + Vector2 scrollPos = Vector2.zero; void GUI_TimeLineView() { if (ActionManager.actionData == null) -- cgit v1.1-26-g67d0