You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
656 B
C#
23 lines
656 B
C#
using CleverCrow.Fluid.BTs.Tasks;
|
|
|
|
namespace CleverCrow.Fluid.BTs.TaskParents.Composites {
|
|
public class Sequence : CompositeBase {
|
|
public override string IconPath { get; } = $"{PACKAGE_ROOT}/RightArrow.png";
|
|
|
|
protected override TaskStatus OnUpdate () {
|
|
for (var i = ChildIndex; i < Children.Count; i++) {
|
|
var child = Children[ChildIndex];
|
|
|
|
var status = child.Update();
|
|
if (status != TaskStatus.Success) {
|
|
return status;
|
|
}
|
|
|
|
ChildIndex++;
|
|
}
|
|
|
|
return TaskStatus.Success;
|
|
}
|
|
}
|
|
}
|