public static SimpleCoroutineAwaiter <object> GetAwaiter(this IEnumerator coroutine)
        {
            var awaiter = new SimpleCoroutineAwaiter <object>();

            ContextUtils.RunOnUnityScheduler(() => AsyncCoroutineRunner.Instance.StartCoroutine(
                                                 new CoroutineWrapper <object>(coroutine, awaiter).Run()));
            return(awaiter);
        }
        private static SimpleCoroutineAwaiter <T> GetAwaiterReturnSelf <T>(T instruction)
        {
            var awaiter = new SimpleCoroutineAwaiter <T>();

            ContextUtils.RunOnUnityScheduler(() => AsyncCoroutineRunner.Instance.StartCoroutine(
                                                 InstructionWrappers.ReturnSelf(awaiter, instruction)));
            return(awaiter);
        }
        public static SimpleCoroutineAwaiter <UnityEngine.Object> GetAwaiter(this AssetBundleRequest instruction)
        {
            var awaiter = new SimpleCoroutineAwaiter <UnityEngine.Object>();

            ContextUtils.RunOnUnityScheduler(() => AsyncCoroutineRunner.Instance.StartCoroutine(
                                                 InstructionWrappers.AssetBundleRequest(awaiter, instruction)));
            return(awaiter);
        }
            public void Complete(Exception e)
            {
                m_isDone    = true;
                m_exception = e;

                if (m_continuation != null)
                {
                    ContextUtils.RunOnUnityScheduler(m_continuation);
                }
            }