コード例 #1
0
        public MainThreadCoroutineTaskWrapper(Func <Task> task)
        {
            source = new TaskCompletionSource <object>();

            AsyncSystem.StartOnMainThread(async() =>
            {
                try
                {
                    await task();
                }
                catch (Exception e)
                {
                    Debug.LogError(e);
                }

                source.SetResult(null);
            });
        }
コード例 #2
0
 public void OnCompleted(Action continuation)
 {
     AsyncSystem.StartOnMainThread(continuation);
 }