Vixen
caa30e12
csharp
public sealed class LoopDecorator

Runs the node again: a fixed number of times, until it fails, or until a timeout.

Read the guide page for this →

Fields and properties (1)

  • public override int StateSize

    How many bytes of per-agent state it needs.

Methods (6)

  • public LoopDecorator(int times)

    Loops a fixed number of times.

  • public static LoopDecorator UntilFailure(float timeoutSeconds = 0)

    Loops until the node fails.

  • public static LoopDecorator Forever(float timeoutSeconds)

    Loops for ever, with a timeout.

  • public override bool Evaluate(in BehaviorContext context, ReadOnlySpan<byte> state)

    Whether the node may be entered, or may keep running.

  • public override void Enter(in BehaviorContext context, Span<byte> state)

    The node is being entered.

  • public override bool ShouldRepeat(in BehaviorContext context, Span<byte> state, ActionStatus result)

    Whether the node should run again instead of returning.

Used by (2)

  • BehaviorTreeDecoratorTestsVixen.Ai.Tests
  • BuildStateVixen.Ai