/// <summary> /// Create an action node. /// </summary> public BehaviourTreeBuilder Do(string name, BehaviourActionDelegate fn) { if (parentNodeStack.Count <= 0) { throw new ApplicationException("Can't create an unnested ActionNode, it must be a leaf node."); } var actionNode = new BehaviorAction(fn); parentNodeStack.Peek().AddChild(actionNode); return(this); }
public BehaviorAction(BehaviourActionDelegate action) { _Action = action; }