Fix renaming selected actor in scene tree after creation and use editor shortcut

This commit is contained in:
Wojtek Figat
2021-06-01 21:10:57 +02:00
parent 0f01683c06
commit 0aa9c865ca
4 changed files with 16 additions and 17 deletions

View File

@@ -163,7 +163,13 @@ namespace FlaxEditor.Windows.Assets
private void Rename()
{
((ActorNode)Selection[0]).TreeNode.StartRenaming();
var selection = Selection;
if (selection.Count != 0 && selection[0] is ActorNode actor)
{
if (selection.Count != 0)
Select(actor);
actor.TreeNode.StartRenaming();
}
}
/// <summary>

View File

@@ -184,6 +184,7 @@ namespace FlaxEditor.Windows.Assets
InputActions.Add(options => options.Paste, Paste);
InputActions.Add(options => options.Duplicate, Duplicate);
InputActions.Add(options => options.Delete, Delete);
InputActions.Add(options => options.Rename, Rename);
InputActions.Add(options => options.FocusSelection, _viewport.FocusSelection);
}