summaryrefslogtreecommitdiff
path: root/Assets/ThirdParty/Behavior Designer/Runtime/Composites/Sequence.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2022-03-10 14:07:40 +0800
committerchai <chaifix@163.com>2022-03-10 14:07:40 +0800
commit22891bf59032ba88262824255a706d652031384b (patch)
tree7595439ba9966c9402d37e37cee5e8cf098757d5 /Assets/ThirdParty/Behavior Designer/Runtime/Composites/Sequence.cs
parent8b04ea73e540067f83870b61d89db4868fea5e8a (diff)
* move folder
Diffstat (limited to 'Assets/ThirdParty/Behavior Designer/Runtime/Composites/Sequence.cs')
-rw-r--r--Assets/ThirdParty/Behavior Designer/Runtime/Composites/Sequence.cs46
1 files changed, 0 insertions, 46 deletions
diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Composites/Sequence.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Composites/Sequence.cs
deleted file mode 100644
index c82ce730..00000000
--- a/Assets/ThirdParty/Behavior Designer/Runtime/Composites/Sequence.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-namespace BehaviorDesigner.Runtime.Tasks
-{
- [TaskDescription("The sequence task is similar to an \"and\" operation. It will return failure as soon as one of its child tasks return failure. " +
- "If a child task returns success then it will sequentially run the next task. If all child tasks return success then it will return success.")]
- [HelpURL("http://www.opsive.com/assets/BehaviorDesigner/documentation.php?id=25")]
- [TaskIcon("{SkinColor}SequenceIcon.png")]
- public class Sequence : Composite
- {
- // The index of the child that is currently running or is about to run.
- private int currentChildIndex = 0;
- // The task status of the last child ran.
- private TaskStatus executionStatus = TaskStatus.Inactive;
-
- public override int CurrentChildIndex()
- {
- return currentChildIndex;
- }
-
- public override bool CanExecute()
- {
- // We can continue to execuate as long as we have children that haven't been executed and no child has returned failure.
- return currentChildIndex < children.Count && executionStatus != TaskStatus.Failure;
- }
-
- public override void OnChildExecuted(TaskStatus childStatus)
- {
- // Increase the child index and update the execution status after a child has finished running.
- currentChildIndex++;
- executionStatus = childStatus;
- }
-
- public override void OnConditionalAbort(int childIndex)
- {
- // Set the current child index to the index that caused the abort
- currentChildIndex = childIndex;
- executionStatus = TaskStatus.Inactive;
- }
-
- public override void OnEnd()
- {
- // All of the children have run. Reset the variables back to their starting values.
- executionStatus = TaskStatus.Inactive;
- currentChildIndex = 0;
- }
- }
-} \ No newline at end of file