Esempio n. 1
0
        public static SimpleCoroutineAwaiter <object> GetAwaiter(this IEnumerator coroutine)
        {
            var awaiter        = new SimpleCoroutineAwaiter <object>();
            var simple_routine = new CoroutineWrapper <object>(coroutine, awaiter).Run();

            RunOnUnityScheduler(() => AsyncCoroutineRunnerGlobal.StartRoutine(simple_routine, nameof(GetAwaiter) + "(object)"));

            return(awaiter);
        }
Esempio n. 2
0
        public static SimpleCoroutineAwaiter <T> GetAwaiter <T>(this IEnumerator <T> coroutine)
        {
            var awaiter        = new SimpleCoroutineAwaiter <T>();
            var simple_routine = new CoroutineWrapper <T>(coroutine, awaiter).Run();

            RunOnUnityScheduler(() => AsyncCoroutineRunnerGlobal.StartRoutine(simple_routine, nameof(GetAwaiter) + "<" + typeof(T).Name + ">"));

            return(awaiter);
        }
Esempio n. 3
0
        public static SimpleCoroutineAwaiter <UnityEngine.Object> GetAwaiter(this AssetBundleRequest instruction)
        {
            var awaiter = new SimpleCoroutineAwaiter <UnityEngine.Object>();
            var asset_bundle_request = InstructionWrappers.AssetBundleRequest(awaiter, instruction);

            RunOnUnityScheduler(() => AsyncCoroutineRunnerGlobal.StartRoutine(asset_bundle_request, nameof(AssetBundleRequest)));

            return(awaiter);
        }
Esempio n. 4
0
        public static SimpleCoroutineAwaiter <UnityEngine.Object> GetAwaiter(this ResourceRequest instruction)
        {
            var awaiter          = new SimpleCoroutineAwaiter <UnityEngine.Object>();
            var resource_request = InstructionWrappers.ResourceRequest(awaiter, instruction);

            RunOnUnityScheduler(() => AsyncCoroutineRunnerGlobal.StartRoutine(resource_request, nameof(GetAwaiter) + "(UnityObject)"));

            return(awaiter);
        }
Esempio n. 5
0
        static SimpleCoroutineAwaiter <T> GetAwaiterReturnSelf <T>(T instruction)
        {
            var awaiter     = new SimpleCoroutineAwaiter <T>();
            var return_self = InstructionWrappers.ReturnSelf(awaiter, instruction);

            RunOnUnityScheduler(() => AsyncCoroutineRunnerGlobal.StartRoutine(return_self));

            return(awaiter);
        }
Esempio n. 6
0
        static SimpleCoroutineAwaiter GetAwaiterReturnVoid(object instruction)
        {
            var awaiter     = new SimpleCoroutineAwaiter();
            var return_void = InstructionWrappers.ReturnVoid(awaiter, instruction);

            RunOnUnityScheduler(() => AsyncCoroutineRunnerGlobal.StartRoutine(return_void));

            return(awaiter);
        }