MonoBehaviourExtensions.RepeatUntil

Extension Method in MonoBehaviourExtensions

Declaration

public static Coroutine RepeatUntil(this MonoBehaviour behavior, Func<bool> condition, Action action, float interval)

Description

Repeats an action at a set interval until a condition is met.

Parameters

behaviorThe behavior to execute the action on.
conditionThe condition to check.
actionThe action to execute.
intervalThe interval to repeat the action, in seconds.

Returns

CoroutineThe coroutine.