Add batch creating prefabs from mutiple selected actors in the scene tree.

This commit is contained in:
Chandler Cox
2023-07-20 23:02:26 -05:00
parent b2b10ce7da
commit 83427ba1d4
2 changed files with 36 additions and 18 deletions

View File

@@ -45,8 +45,14 @@ namespace FlaxEditor.Content.GUI
private void ImportActors(DragActors actors, ContentFolder location)
{
// Use only the first actor
Editor.Instance.Prefabs.CreatePrefab(actors.Objects[0].Actor);
foreach (var actorNode in actors.Objects)
{
var actor = actorNode.Actor;
if (actors.Objects.Contains(actorNode.ParentNode as ActorNode))
continue;
Editor.Instance.Prefabs.CreatePrefab(actor, false);
}
}
/// <inheritdoc />