/// <summary>
        /// Process node logic.
        /// </summary>
        public override BehaviourTreeResult Process()
        {
            BehaviourTreeResult res = BehaviourTreeResult.Success;

            for (int i = _currentChild, iMax = _children.Count; i < iMax; i++, _currentChild++)
            {
                res = _children[i].Process();
                if (res != BehaviourTreeResult.Fail)
                {
                    break;
                }
            }
            if (res != BehaviourTreeResult.Pending)
            {
                _currentChild = 0;
            }
            return(res);
        }
 public ResultReplacerNode(BehaviourTreeNode <T> child, int index, BehaviourTreeResult fromSuccess, BehaviourTreeResult fromFailure, BehaviourTreeResult fromRunning) : base(child, index)
 {
     this.fromSuccess = fromSuccess;
     this.fromFailure = fromFailure;
     this.fromRunning = fromRunning;
 }