예제 #1
0
 private void AbortCurrentBranch()
 {
     if (abortType == AbortType.Self || abortType == AbortType.Both)
     {
         Iterator.AbortRunningChildBranch(Parent, ChildOrder);
     }
 }
        private void AbortLowerPriorityBranch()
        {
            if (abortType == AbortType.LowerPriority || abortType == AbortType.Both)
            {
                GetCompositeParent(this, out BehaviourNode compositeParent, out int branchIndex);

                if (compositeParent && compositeParent.IsComposite())
                {
                    bool isLowerPriority = (compositeParent as Composite).CurrentChildIndex > branchIndex;
                    if (isLowerPriority)
                    {
                        Iterator.AbortRunningChildBranch(compositeParent, branchIndex);
                    }
                }
            }
        }
예제 #3
0
 private void AbortLowerPriorityBranch()
 {
     if (abortType == AbortType.LowerPriority || abortType == AbortType.Both)
     {
         GetCompositeParent(this, out BTNode compositeParent, out int branchIndex);
         if (compositeParent != null)
         {
             if (compositeParent is BTComposite _composite)
             {
                 bool isLowerPriority = _composite.CurrentChildIndex > branchIndex;
                 if (isLowerPriority)
                 {
                     Iterator.AbortRunningChildBranch(compositeParent, branchIndex);
                 }
             }
         }
     }
 }