Google Drive for Unity3D
|
Unity3D coroutine object. More...
Public Member Functions | |
UnityCoroutine (Action< UnityCoroutine > doneCallback) | |
Create a Unity coroutine with the done callback. | |
void | DoSync () |
Run all remaining routines at this time. | |
bool | MoveNext () |
Run the routines. | |
void | Reset () |
Clear queued routines. | |
Protected Member Functions | |
UnityCoroutine () | |
Create a Unity coroutine without the done callback. | |
Protected Attributes | |
Queue< Action > | routines = new Queue<Action>() |
Run the routines one at a time(each routine at each update). | |
Properties | |
bool | isDone [get, set] |
All processing is done. | |
Action< UnityCoroutine > | done [get, set] |
Done callback function getter/setter. | |
object | Current [get] |
Remaining routines count. |
Unity3D coroutine object.
Usage with Unity3D coroutine.
IEnumerator SomeCoroutine() { // Wait for the coroutine to finish. yield return StartCoroutine(new SomeUnityCoroutine1()); // Do something after 'SomeUnityCoroutine1' finished. // ... // Run this coroutine and 'SomeUnityCorutine2' at same time. SomeUnityCoroutine2 routine2 = new SomeUnityCoroutine2(); StartCoroutine(routine2); // Do parallel works. // ... // And wait for 'SomeUnityCoroutine2'. while (!routine2.isDone) yield return null; }
Usage with the done callback.
StartCoroutine(new SomeUnityCoroutine((coroutine) => { // Done! SomeUnityCoroutine r = coroutine as SomeUnityCoroutine; print(r.someResult); // ... }));
Midworld.UnityCoroutine.UnityCoroutine | ( | ) | [protected] |
Create a Unity coroutine without the done callback.
Midworld.UnityCoroutine.UnityCoroutine | ( | Action< UnityCoroutine > | doneCallback | ) |
Create a Unity coroutine with the done callback.
doneCallback | Done callback function. |
void Midworld.UnityCoroutine.DoSync | ( | ) |
Run all remaining routines at this time.
bool Midworld.UnityCoroutine.MoveNext | ( | ) |
Run the routines.
void Midworld.UnityCoroutine.Reset | ( | ) |
Clear queued routines.
Queue<Action> Midworld.UnityCoroutine.routines = new Queue<Action>() [protected] |
Run the routines one at a time(each routine at each update).
Do not dequeue manually.
object Midworld.UnityCoroutine.Current [get] |
Remaining routines count.
Action<UnityCoroutine> Midworld.UnityCoroutine.done [get, set] |
Done callback function getter/setter.
Done callback run immediately if the coroutine is already done.
bool Midworld.UnityCoroutine.isDone [get, set] |
All processing is done.
Callback the done function only once when the flag set true. If this UnityCorouine started by StartCoroutine() then done function will run in main thread. If it is not then the function will run in the working thread.