Add rename multiple actors
This commit is contained in:
@@ -13,7 +13,6 @@ using FlaxEditor.Scripting;
|
||||
using FlaxEditor.States;
|
||||
using FlaxEngine;
|
||||
using FlaxEngine.GUI;
|
||||
using static FlaxEditor.GUI.ItemsListContextMenu;
|
||||
|
||||
namespace FlaxEditor.Windows
|
||||
{
|
||||
@@ -138,10 +137,24 @@ namespace FlaxEditor.Windows
|
||||
private void Rename()
|
||||
{
|
||||
var selection = Editor.SceneEditing.Selection;
|
||||
if (selection.Count != 0 && selection[0] is ActorNode actor)
|
||||
var selectionCount = selection.Count;
|
||||
|
||||
// Show a window with options to rename multiple actors.
|
||||
if (selectionCount > 1)
|
||||
{
|
||||
if (selection.Count != 0)
|
||||
Editor.SceneEditing.Select(actor);
|
||||
var selectedActors = new Actor[selectionCount];
|
||||
|
||||
for (int i = 0; i < selectionCount; i++)
|
||||
if (selection[i] is ActorNode actorNode)
|
||||
selectedActors[i] = actorNode.Actor;
|
||||
|
||||
new RenameWindow(selectedActors, Editor).Show();
|
||||
return;
|
||||
}
|
||||
|
||||
if (selectionCount != 0 && selection[0] is ActorNode actor)
|
||||
{
|
||||
Editor.SceneEditing.Select(actor);
|
||||
actor.TreeNode.StartRenaming(this, _sceneTreePanel);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user