namespace ColdMint.scripts.behaviorTree.framework;
///
/// Selector node
/// 选择器节点
///
///
///Select an execution of the child node and pass the execution result to the parent node
///选择其子节点的某一个执行,并将执行结果传递给父节点
///
public abstract class SelectorNode : BehaviorTreeNodeTemplate
{
public override int Execute(bool isPhysicsProcess, double delta)
{
var behaviorTreeNode = SelectNode(isPhysicsProcess, delta, Children);
if (behaviorTreeNode == null)
{
return Config.BehaviorTreeResult.Failure;
}
return behaviorTreeNode.Execute(isPhysicsProcess, delta);
}
///
/// Select an abstract method for the node
/// 选择节点的抽象方法
///
///
public abstract IBehaviorTreeNode SelectNode(bool isPhysicsProcess, double delta, IBehaviorTreeNode[] children);
}