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
action
ActionThe action to execute every specified number of frames.
frameInterval
intThe 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
action
ActionThe action to execute every specified number of frames.
frameInterval
intThe number of frames to wait before executing the action.
repeatCount
intThe 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
action
ActionThe action to execute after the delay.
delay
floatThe 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
action
ActionThe action to execute at random intervals.
minDelay
floatThe minimum delay in seconds before executing the action.
maxDelay
float/// 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
action
ActionThe action to execute at random intervals.
minDelay
floatThe minimum delay in seconds before executing the action.
maxDelay
floatThe maximum delay in seconds before executing the action.
repeatCount
intThe 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
action
ActionThe action to execute repeatedly.
delay
floatThe 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
action
ActionThe action to execute repeatedly.
delay
floatThe delay in seconds between each execution of the action.
repeatCount
intThe 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
coroutine
CoroutineThe Coroutine object to stop.