/// <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);
        }
Esempio n. 2
0
 public BehaviorAction(BehaviourActionDelegate action)
 {
     _Action = action;
 }
		public BehaviorAction(BehaviourActionDelegate action)
        {
            _Action = action;
        }