From 2fa67922f08ef39b4d70bad001592aedf22c9018 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 8 Sep 2021 19:18:57 +0800 Subject: *misc --- Assets/ActionTool/Editor/ActionRootMotionEditor.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'Assets/ActionTool/Editor/ActionRootMotionEditor.cs') diff --git a/Assets/ActionTool/Editor/ActionRootMotionEditor.cs b/Assets/ActionTool/Editor/ActionRootMotionEditor.cs index f6a97efe..020c86b6 100644 --- a/Assets/ActionTool/Editor/ActionRootMotionEditor.cs +++ b/Assets/ActionTool/Editor/ActionRootMotionEditor.cs @@ -38,11 +38,15 @@ namespace ActionTool tex.Apply(); IsRecord = false; + + ActionManager.gizmos.ShowRootMotionGizmos(true); } private void OnDisable() { IsRecord = false; + + ActionManager.gizmos.ShowRootMotionGizmos(false); } private void Update() @@ -74,7 +78,7 @@ namespace ActionTool { x += kToolbarControlMargin; Rect rect = new Rect(x, y, kToolbarControlSize, kToolbarControlSize); - IsRecord = GUI.Toggle(rect, IsRecord, EditorGUIUtility.IconContent("d_Animation.Record"), GUI.skin.button); + IsRecord = GUI.Toggle(rect, IsRecord, EditorGUIUtility.IconContent("d_Animation.Record", "Record"), GUI.skin.button); x += kToolbarControlSize; } @@ -84,17 +88,19 @@ namespace ActionTool GUI.enabled = false; x += kToolbarControlMargin; Rect rect = new Rect(x, y, kToolbarControlSize, kToolbarControlSize); - if (GUI.Button(rect, m_UITextureTakeRecord)) + if (GUI.Button(rect, EditorGUIUtility.IconContent("Animation.AddKeyframe", "Key Frame"))) { Vector3 pos = ActionManager.unitInstance.transform.position; int frame = (int)ActionManager.actionData.curAnimFrame; ActionManager.animationData.rootMotionOverrideData.SetPosition(frame, pos); ActionManager.PreviewWindow.Repaint(); + EditorWindow.GetWindow()?.Repaint(); + SceneView.RepaintAll(); } GUI.enabled = true; x += kToolbarControlSize; } - + void GUI_Delete(ref float x, ref float y) { if (!IsRecord) @@ -110,5 +116,6 @@ namespace ActionTool GUI.enabled = true; x += kToolbarControlSize; } + } } \ No newline at end of file -- cgit v1.1-26-g67d0