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