Ejemplo n.º 1
0
        /// <summary>
        /// 删除传入的task, 本是是放在任务队列中
        /// </summary>
        public void RemoveResourceConsumingTask(UGameplayTask Task)
        {
            var e = new FGameplayTaskEventData(EGameplayTaskEvent.Remove, Task);

            TaskEvents.Add(e);
            // trigger the actual processing only if it was the first event added to the list
            if (TaskEvents.Count == 1 && CanProcessEvents())
            {
                ProcessTaskEvents();
            }
        }
Ejemplo n.º 2
0
        //处理 优先级 和 资源
        /// <summary>
        /// 处理传入的task, 如果本task没有优先级或者资源依赖就不处理
        /// </summary>
        public void AddTaskReadyForActivation(UGameplayTask NewTask)
        {
            if (!NewTask.RequiresPriorityOrResourceManagement())
            {
                return;
            }

            var e = new FGameplayTaskEventData(EGameplayTaskEvent.Add, NewTask);

            TaskEvents.Add(e);

            // trigger the actual processing only if it was the first event added to the list
            if (TaskEvents.Count == 1 && CanProcessEvents())
            {
                ProcessTaskEvents();
            }
        }