Cleanup 8
This commit is contained in:
@@ -215,20 +215,17 @@ namespace FlaxEditor.Windows.Assets
|
||||
{
|
||||
if (actor == null)
|
||||
throw new ArgumentNullException(nameof(actor));
|
||||
if (parent == null)
|
||||
throw new ArgumentNullException(nameof(parent));
|
||||
|
||||
// Link it
|
||||
actor.Parent = parent;
|
||||
actor.Parent = parent ?? throw new ArgumentNullException(nameof(parent));
|
||||
|
||||
// Peek spawned node
|
||||
var actorNode = SceneGraphFactory.FindNode(actor.ID) as ActorNode ?? SceneGraphFactory.BuildActorNode(actor);
|
||||
if (actorNode == null)
|
||||
throw new InvalidOperationException("Failed to create scene node for the spawned actor.");
|
||||
|
||||
var parentNode = SceneGraphFactory.FindNode(parent.ID) as ActorNode;
|
||||
if (parentNode == null)
|
||||
throw new InvalidOperationException("Missing scene graph node for the spawned parent actor.");
|
||||
actorNode.ParentNode = parentNode;
|
||||
actorNode.ParentNode = parentNode ?? throw new InvalidOperationException("Missing scene graph node for the spawned parent actor.");
|
||||
|
||||
// Call post spawn action (can possibly setup custom default values)
|
||||
actorNode.PostSpawn();
|
||||
|
||||
Reference in New Issue
Block a user