SpicyPixel.Threading.Tasks.FiberTaskScheduler.ExecuteTask C# (CSharp) 메소드

ExecuteTask() 개인적인 메소드

Execute the specified task as a coroutine.
private ExecuteTask ( Task task ) : IEnumerator
task Task /// The task to be executed. ///
리턴 IEnumerator
        private IEnumerator ExecuteTask(Task task)
        {
            // Execute yieldable actions using the MonoBehavior.
            //
            // The continuation will execute the task itself
            // via TryExecuteTask(). That task action will
            // rethrow any exceptions caught during the yieldable
            // action invocation and TryExecuteTask() will set
            // the final state.
            //
            // The downside to this approach is that yieldable tasks
            // aren't considered running until they have already
            // completed because TryExecuteTask() is what sets state.
            var yieldableTask = task as YieldableTask;
            if(yieldableTask != null)
                yield return Fiber.Factory.StartNew(ExecuteYieldableTask(yieldableTask), scheduler);

            // Run the action
            TryExecuteTask(task);
        }