示例#1
0
        public override void Activate()
        {
            status = Status.Active;
            RemoveAllSubtasks();

            targetSystem.Update();

            if (targetSystem.HasTarget)
            {
                if (targetSystem.CurrentTarget.tag == "Cell")
                {
                    AddSubtask(new Loot(agent, targetSystem.CurrentTarget));
                }
                else
                {
                    AddSubtask(new Attack(agent, targetSystem.CurrentTarget));
                }
            }
            else
            {
                AddSubtask(new Explore(agent, Random.Range(4.0f, 8.0f), Random.Range(3.0f, 6.0f)));
            }
        }