set spline point as selected when has a tangent selected and set as linear

This commit is contained in:
Ruan Lucas
2023-07-18 21:54:30 -04:00
parent 2fac4c9284
commit 590a892f16

View File

@@ -6,6 +6,7 @@ using FlaxEngine;
using FlaxEngine.GUI;
using FlaxEditor.CustomEditors.Elements;
using System;
using FlaxEditor.SceneGraph;
namespace FlaxEditor.CustomEditors.Dedicated
{
@@ -99,6 +100,14 @@ namespace FlaxEditor.CustomEditors.Dedicated
public override void OnSetMode(Spline spline, int index)
{
SetKeyframeLinear(spline, index);
// if has a tangent selected, change the selection to tangent parent (a spline point / keyframe)
var currentSelection = Editor.Instance.SceneEditing.Selection;
if (currentSelection.Count == 1 && currentSelection[0] is SplineNode.SplinePointTangentNode)
{
var selectedTangentNode = currentSelection[0] as SplineNode.SplinePointTangentNode;
Editor.Instance.SceneEditing.Select(selectedTangentNode.ParentNode);
}
}
private void SetKeyframeLinear(Spline spline, int index)