Пример #1
0
        /// <summary>
        /// Create an succeeder node that always returns success.
        /// </summary>
        public BehaviourTreeBuilder Succeeder(string name)
        {
            var succeederNode = new SucceederNode(name);

            if (parentNodeStack.Count > 0)
            {
                parentNodeStack.Peek().AddChild(succeederNode);
            }

            parentNodeStack.Push(succeederNode);
            return(this);
        }
Пример #2
0
        /// <summary>
        /// Create an succeeder node that always returns success.
        /// </summary>
        public BehaviourTreeBuilder <T> Succeeder(string name)
        {
            var succeederNode = new SucceederNode <T>(name, ++_idCounter);

            if (_parentNodeStack.Count > 0)
            {
                _parentNodeStack.Peek().AddChild(succeederNode);
            }

            _parentNodeStack.Push(succeederNode);
            return(this);
        }