public static CoroutineAsyncBridge Start <T>(T awaitTarget) { var bridge = new CoroutineAsyncBridge(); MainThreadDispatcher.StartCoroutine(bridge.Run(awaitTarget)); return(bridge); }
public static CoroutineAsyncBridge GetAwaiter(this Coroutine coroutine) { return CoroutineAsyncBridge.Start(coroutine); }
public static CoroutineAsyncBridge GetAwaiter(this IEnumerator coroutine) { return CoroutineAsyncBridge.Start(coroutine); }
#pragma warning restore CS0618 #endif public static CoroutineAsyncBridge<AsyncOperation> GetAwaiter(this AsyncOperation asyncOperation) { return CoroutineAsyncBridge<AsyncOperation>.Start(asyncOperation); }
// should use UniRx.Async in C# 7.0 #if UNITY_2018_3_OR_NEWER #pragma warning disable CS0618 #endif public static CoroutineAsyncBridge<WWW> GetAwaiter(this WWW www) { return CoroutineAsyncBridge<WWW>.Start(www); }
public static CoroutineAsyncBridge <UnityWebRequest> GetAwaiter(this UnityWebRequest www) { return(CoroutineAsyncBridge <UnityWebRequest> .Start(www)); }