Fix spawned in Editor actor RigidBody to never be static
This commit is contained in:
29
Source/Editor/SceneGraph/Actors/RigidBodyNode.cs
Normal file
29
Source/Editor/SceneGraph/Actors/RigidBodyNode.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||
|
||||
using FlaxEngine;
|
||||
|
||||
namespace FlaxEditor.SceneGraph.Actors
|
||||
{
|
||||
/// <summary>
|
||||
/// Scene tree node for <see cref="RigidBody"/> actor type.
|
||||
/// </summary>
|
||||
[HideInEditor]
|
||||
public sealed class RigidBodyNode : ActorNode
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public RigidBodyNode(Actor actor)
|
||||
: base(actor)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void PostSpawn()
|
||||
{
|
||||
base.PostSpawn();
|
||||
|
||||
if (HasPrefabLink)
|
||||
return;
|
||||
Actor.StaticFlags = StaticFlags.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,6 +74,7 @@ namespace FlaxEditor.SceneGraph
|
||||
CustomNodesTypes.Add(typeof(NavMesh), typeof(ActorNode));
|
||||
CustomNodesTypes.Add(typeof(SpriteRender), typeof(SpriteRenderNode));
|
||||
CustomNodesTypes.Add(typeof(Joint), typeof(JointNode));
|
||||
CustomNodesTypes.Add(typeof(RigidBody), typeof(RigidBodyNode));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user