Class that manages Coroutines.
More...
|
| Coroutine () |
| Create a new Coroutine manager. More...
|
|
int | Start (IEnumerator routine) |
| Starts a new coroutine and returns an int id for that routine. More...
|
|
void | StopAll () |
| Immediately clear and stop all Coroutines. More...
|
|
void | Stop (int routineId) |
| Stop a routine from running based off its int id. More...
|
|
void | Update () |
| Updates all the routines. The coroutine in the Game automatically runs this. More...
|
|
void | PublishEvent (string id) |
| Publishes an event to the coroutine manager. Used for WaitForEvent. Events are cleared on every update. More...
|
|
void | PublishEvent (Enum id) |
| Publishes an event to the coroutine manager. Used for WaitForEvent. Events are cleared on every update. More...
|
|
IEnumerator | WaitForEvent (string id) |
| Waits until a specific event has been published. More...
|
|
IEnumerator | WaitForEvent (Enum id) |
| Waits until a specific event has been published. More...
|
|
bool | HasEvent (string id) |
| Check if an event has been published. More...
|
|
bool | HasEvent (Enum id) |
| Check if an event has been published. More...
|
|
IEnumerator | WaitForSeconds (float seconds) |
| Waits until an amount of time has passed. More...
|
|
IEnumerator | WaitForFrames (int frames) |
| Waits until an amount of frames have passed. Don't use this with non-fixed framerates. More...
|
|
IEnumerator | WaitForTween (Tween tween) |
| Waits for a Tween to complete. More...
|
|
IEnumerator | WaitForDelegate (Func< bool > func) |
| Waits for an anonymous method that returns true or false. More...
|
|
Class that manages Coroutines.
Otter.Coroutine.Coroutine |
( |
| ) |
|
bool Otter.Coroutine.HasEvent |
( |
string |
id | ) |
|
Check if an event has been published.
- Parameters
-
id | The string id of the event. |
- Returns
- True if the event has been published.
bool Otter.Coroutine.HasEvent |
( |
Enum |
id | ) |
|
Check if an event has been published.
- Parameters
-
id | The enum id of the event. |
- Returns
- True if the event has been published.
void Otter.Coroutine.PublishEvent |
( |
string |
id | ) |
|
Publishes an event to the coroutine manager. Used for WaitForEvent. Events are cleared on every update.
- Parameters
-
id | The string id of the event. |
void Otter.Coroutine.PublishEvent |
( |
Enum |
id | ) |
|
Publishes an event to the coroutine manager. Used for WaitForEvent. Events are cleared on every update.
- Parameters
-
id | The enum id of the event. |
int Otter.Coroutine.Start |
( |
IEnumerator |
routine | ) |
|
Starts a new coroutine and returns an int id for that routine.
- Parameters
-
routine | The coroutine to start running. |
- Returns
- A unique int id for that routine.
void Otter.Coroutine.Stop |
( |
int |
routineId | ) |
|
Stop a routine from running based off its int id.
- Parameters
-
routineId | The id of the routine to stop. |
void Otter.Coroutine.StopAll |
( |
| ) |
|
Immediately clear and stop all Coroutines.
void Otter.Coroutine.Update |
( |
| ) |
|
Updates all the routines. The coroutine in the Game automatically runs this.
IEnumerator Otter.Coroutine.WaitForDelegate |
( |
Func< bool > |
func | ) |
|
Waits for an anonymous method that returns true or false.
- Parameters
-
func | The method to run until it returns true. |
- Returns
IEnumerator Otter.Coroutine.WaitForEvent |
( |
string |
id | ) |
|
Waits until a specific event has been published.
- Parameters
-
id | The string id of the event. |
- Returns
IEnumerator Otter.Coroutine.WaitForEvent |
( |
Enum |
id | ) |
|
Waits until a specific event has been published.
- Parameters
-
id | The enum id of the event. |
- Returns
IEnumerator Otter.Coroutine.WaitForFrames |
( |
int |
frames | ) |
|
Waits until an amount of frames have passed. Don't use this with non-fixed framerates.
- Parameters
-
frames | The number of frames to wait. |
- Returns
IEnumerator Otter.Coroutine.WaitForSeconds |
( |
float |
seconds | ) |
|
Waits until an amount of time has passed.
- Parameters
-
seconds | The number of seconds to wait. |
- Returns
IEnumerator Otter.Coroutine.WaitForTween |
( |
Tween |
tween | ) |
|
Waits for a Tween to complete.
- Parameters
-
tween | The Tween to wait on. |
- Returns
int Otter.Coroutine.Count |
|
get |
The current number of running routines.
bool Otter.Coroutine.Running |
|
get |
If any routines are currently running.
The documentation for this class was generated from the following file:
- Otter/Utility/Coroutine.cs