Class Coroutines
Contains methods for managing coroutines in Unity using the IgnorePhysicsDebugSystem.
public class Coroutines
- Inheritance
-
Coroutines
- Inherited Members
- Extension Methods
Methods
StartFrameCoroutine(Action, int)
Starts a coroutine that executes an action every specified number of frames.
public static Coroutine StartFrameCoroutine(Action action, int frameInterval)
Parameters
actionActionThe action to execute every specified number of frames.
frameIntervalintThe number of frames to wait before executing the action.
Returns
- Coroutine
A Coroutine object that can be used to control the coroutine.
StartFrameCoroutine(Action, int, int)
Starts a coroutine that executes an action every specified number of frames for a specified number of repetitions.
public static Coroutine StartFrameCoroutine(Action action, int frameInterval, int repeatCount)
Parameters
actionActionThe action to execute every specified number of frames.
frameIntervalintThe number of frames to wait before executing the action.
repeatCountintThe number of times to repeat the action.
Returns
- Coroutine
A Coroutine object that can be used to control the coroutine.
StartGenericCoroutine(Action, float)
Starts a generic coroutine that executes an action after a specified delay.
public static Coroutine StartGenericCoroutine(Action action, float delay)
Parameters
actionActionThe action to execute after the delay.
delayfloatThe delay in seconds before executing the action.
Returns
- Coroutine
A Coroutine object that can be used to control the coroutine.
StartRandomIntervalCoroutine(Action, float, float)
Starts a coroutine that executes an action at random intervals between a minimum and maximum delay.
public static Coroutine StartRandomIntervalCoroutine(Action action, float minDelay, float maxDelay)
Parameters
actionActionThe action to execute at random intervals.
minDelayfloatThe minimum delay in seconds before executing the action.
maxDelayfloat/// The maximum delay in seconds before executing the action.
Returns
- Coroutine
A Coroutine object that can be used to control the coroutine.
StartRandomIntervalCoroutine(Action, float, float, int)
Starts a coroutine that executes an action at random intervals between a minimum and maximum delay for a specified number of repetitions.
public static Coroutine StartRandomIntervalCoroutine(Action action, float minDelay, float maxDelay, int repeatCount)
Parameters
actionActionThe action to execute at random intervals.
minDelayfloatThe minimum delay in seconds before executing the action.
maxDelayfloatThe maximum delay in seconds before executing the action.
repeatCountintThe number of times to repeat the action.
Returns
- Coroutine
A Coroutine object that can be used to control the coroutine.
StartRepeatingCoroutine(Action, float)
Starts a repeating coroutine that executes an action at regular intervals.
public static Coroutine StartRepeatingCoroutine(Action action, float delay)
Parameters
actionActionThe action to execute repeatedly.
delayfloatThe delay in seconds between each execution of the action.
Returns
- Coroutine
A Coroutine object that can be used to control the coroutine.
StartRepeatingCoroutine(Action, float, int)
Starts a repeating coroutine that executes an action a specified number of times at regular intervals.
public static Coroutine StartRepeatingCoroutine(Action action, float delay, int repeatCount)
Parameters
actionActionThe action to execute repeatedly.
delayfloatThe delay in seconds between each execution of the action.
repeatCountintThe number of times to repeat the action.
Returns
- Coroutine
A Coroutine object that can be used to control the coroutine.
StopCoroutine(Coroutine)
Stops a coroutine that was started with StartGenericCoroutine or any other coroutine method.
public static void StopCoroutine(Coroutine coroutine)
Parameters
coroutineCoroutineThe Coroutine object to stop.