Fix renaming selected actor in scene tree after creation and use editor shortcut
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user