-
Notifications
You must be signed in to change notification settings - Fork 0
API.Service.Task
Namespace: Ju.Services
This service provides helper methods to do asynchronous tasks.
void RunOnMainThread(Action action, float delay = 0f);
IPromise WaitUntil(ILinkHandler handle, Func<bool> condition);
IPromise WaitWhile(ILinkHandler handle, Func<bool> condition);
IPromise WaitForSeconds(ILinkHandler handle, float seconds) where T : ITimeDeltaEvent;
IPromise WaitForTicks(ILinkHandler handle, int ticks) where T : ITimeEvent;
IPromise WaitForNextUpdate(ILinkHandler handle);
IPromise WaitForNextFixedUpdate(ILinkHandler handle);
Refs: IPromise, ILinkHandler, ITimeDeltaEvent, ITimeEvent
Runs the action (with an optional delay) in the next update time event in the main thread.
Useful when you need to run something but you are in another thread context (in a callback of a third party lib for example).
Waits until the condition is true to resolve the returned promise.
Waits until the condition is false to resolve the returned promise.
Waits an amount of time (seconds) and then resolves the returned promise.
Waits an amount of frames (ticks) and then resolves the returned promise.
Waits until next update and then resolves the returned promise.
Waits until next fixed update and then resolves the returned promise.
Return to [Home]
- Home
- Install
- Manual
-
Core API
- Services:
- Util:
-
Unity API
- Services:
- Integrations: