public static Promise <T> QueueOnMainThread <T>(this Promise <T> promise, Promise <T> .Fulfilled onFulfilled, Promise <T> .Failed onFailed = null, Promise <T> .Progressed onProgressed = null) { PromiseService.AddPromise <T>(promise, onFulfilled, onFailed, onProgressed); return(promise); }
static PromiseService getService() { if (_service == null) { _service = new GameObject("PromiseService").AddComponent <PromiseService>(); DontDestroyOnLoad(_service); _service.updateName(); } return(_service); }
void OnDestroy() { _service = null; }