public MainThreadCoroutineTaskWrapper(Func <Task> task) { source = new TaskCompletionSource <object>(); AsyncSystem.StartOnMainThread(async() => { try { await task(); } catch (Exception e) { Debug.LogError(e); } source.SetResult(null); }); }
public void OnCompleted(Action continuation) { AsyncSystem.StartOnMainThread(continuation); }