Beispiel #1
0
    public static void QueueWorkItem(this MonoBehaviour behaviour, string queueName, IEnumerator task, bool startImmediatly)
    {
        var schedule = behaviour.DefaultComponent <UEWorkScheduler>();

        if (startImmediatly)
        {
            schedule.ScheduleWorkItem(queueName, task);
        }
        else
        {
            schedule.ScheduleWorkItemWithoutStarting(queueName, task);
        }
    }
        /// <summary>
        /// Schedules a coroutine to run to be after all tasks in the default queue have run.
        /// </summary>
        /// <param name='behaviour'>
        /// Behaviour.
        /// </param>
        /// <param name='task'>
        /// Task.
        /// </param>
        public static void QueueWorkItem(this MonoBehaviour behaviour, IEnumerator task)
        {
            var schedule = behaviour.DefaultComponent <WorkScheduler> ();

            schedule.ScheduleWorkItem("_default", task);
        }
Beispiel #3
0
    /// <summary>
    /// Schedules a coroutine to run to be after all tasks in the same queue have run.
    /// </summary>
    /// <param name='behaviour'>
    /// Behaviour.
    /// </param>
    /// <param name='queueName'>
    /// Queue name.
    /// </param>
    /// <param name='task'>
    /// Task.
    /// </param>
    public static void QueueWorkItem(this MonoBehaviour behaviour, string queueName, IEnumerator task)
    {
        var schedule = behaviour.DefaultComponent <UEWorkScheduler>();

        schedule.ScheduleWorkItem(queueName, task);
    }
Beispiel #4
0
    public static void ProcessQueue(this MonoBehaviour behaviour, string name, Action onComplete)
    {
        var schedule = behaviour.DefaultComponent <UEWorkScheduler>();

        schedule.StartProcessingQueue(name, onComplete);
    }