Traveller/scripts/behaviorTree/BehaviorNode.cs
Cold-Mint dea683dbc5
No backpack nesting backpack.
禁止背包嵌套背包。
2024-06-25 22:11:19 +08:00

31 lines
684 B
C#

using Godot;
namespace ColdMint.scripts.behaviorTree;
/// <summary>
/// <para>BehaviorNode</para>
/// <para>行为节点</para>
/// </summary>
public partial class BehaviorNode : Node2D
{
public IBehaviorTreeNode? Root { get; set; }
public override void _PhysicsProcess(double delta)
{
InvokeBehaviorTreeNode(true, delta);
}
/// <summary>
/// <para>InvokeBehaviorTreeNode</para>
/// <para>调用行为树节点</para>
/// </summary>
private void InvokeBehaviorTreeNode(bool isPhysicsProcess, double delta)
{
if (Root == null)
{
return;
}
Root.Execute(isPhysicsProcess, delta);
}
}