Esempio n. 1
0
        public void ChangeTask(Task task)
        {
            Blackboard.Erase("NoPath");

            if (CurrentTask.HasValue(out var previousTask))
            {
                previousTask.OnUnAssign(this);
            }

            CurrentTask = task;

            if (CurrentTask.HasValue(out var newTask))
            {
                ChangeAct(newTask.CreateScript(Creature));

                if (Tasks.Contains(task))
                {
                    Tasks.Remove(task);
                }
                else
                {
                    task.OnAssign(this);
                }
            }
            else
            {
                ChangeAct(null);
            }
        }
Esempio n. 2
0
        public void ChangeTask(Task task)
        {
            Blackboard.Erase("NoPath");
            if (CurrentTask != null)
                CurrentTask.OnUnAssign(this);
            CurrentTask = task;
            if (CurrentTask != null)
            {
                ChangeAct(CurrentTask.CreateScript(Creature));

                if (Tasks.Contains(task))
                    Tasks.Remove(task);
                else
                    task.OnAssign(this);
            }
            else
            {
                ChangeAct(null);
            }
        }