Fix trying to add scene to actor group.

This commit is contained in:
Chandler Cox
2025-05-02 21:58:02 -05:00
parent f0bcc70563
commit 2a5aed6c15

View File

@@ -5,6 +5,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using FlaxEditor.Actions; using FlaxEditor.Actions;
using FlaxEditor.SceneGraph; using FlaxEditor.SceneGraph;
using FlaxEditor.SceneGraph.Actors;
using FlaxEngine; using FlaxEngine;
namespace FlaxEditor.Modules namespace FlaxEditor.Modules
@@ -561,7 +562,8 @@ namespace FlaxEditor.Modules
public void CreateParentForSelectedActors() public void CreateParentForSelectedActors()
{ {
List<SceneGraphNode> selection = Editor.SceneEditing.Selection; List<SceneGraphNode> selection = Editor.SceneEditing.Selection;
var actors = selection.Where(x => x is ActorNode).Select(x => ((ActorNode)x).Actor); // Get Actors but skip scene node
var actors = selection.Where(x => x is ActorNode and not SceneNode).Select(x => ((ActorNode)x).Actor);
var actorsCount = actors.Count(); var actorsCount = actors.Count();
if (actorsCount == 0) if (actorsCount == 0)
return; return;