public override void ActionStart(AI_Mission_Base mission, AI_Base brain, Character_Base character)
    {
        base.ActionStart(mission, brain, character);
        agent = character.GetComponent<NavMeshAgent>();

        agent.CalculatePath(TargetPosition, path);
    }
Ejemplo n.º 2
0
 public void Update()
 {
     if (DebugAI)
     {
         AI_Mission_Base mission = DebugAI.currentMission;
         if (mission != null)
         {
             CurrentMissionText.text = mission.ToString();
             if (mission.GetCurrentAction() != null)
             {
                 ActionListText[0].text = mission.GetCurrentAction().ToString();
             }
             for (int i = 1; i < ActionListText.Length; i++)
             {
                 if (i <= mission.ActionList.Count)
                 {
                     ActionListText[i].text  = mission.ActionList[i - 1].ToString();
                     ActionListText[i].color = new Color(0.3f, 0.3f, 0.3f);
                 }
                 else
                 {
                     ActionListText[i].text = "";
                 }
             }
         }
     }
 }
 public override void MissionAbort(AI_Base brain, Character_Base character, AI_Mission_Base newMission)
 {
     base.MissionAbort(brain, character, newMission);
     if (TargetItem)
     {
         TargetItem.ReleaseSlot(ownerCharacter);
     }
 }
Ejemplo n.º 4
0
 public override void ActionStart(AI_Mission_Base mission, AI_Base brain, Character_Base character)
 {
     base.ActionStart(mission, brain, character);
     if (character.canAttack())
     {
         character.AttackCommand(TargetTransform.position - Character.transform.position);
         ActionFinish();
     }
 }
Ejemplo n.º 5
0
 public override void ActionStart(AI_Mission_Base mission, AI_Base brain, Character_Base character)
 {
     base.ActionStart(mission, brain, character);
     if (Item)
     {
         Item.InteractStart(character);
         timer         = Duration;
         isInteracting = true;
         Behaviour b = character.StartBehaviour(new Behaviour(AnimationName, Duration, BehaviourType.Interact, new float[] {}));
         b.BehaviourFinishEvent += OnBehaviourFinish;
     }
 }
Ejemplo n.º 6
0
    public void StartNewMission(AI_Mission_Base mission, int Priority = 0)
    {
        mission.Priority = Priority;
        int oldPriority = -1;

        if (currentMission != null)
        {
            oldPriority = currentMission.Priority;
        }

        if (Priority > oldPriority)
        {
            if (currentMission != null)
            {
                currentMission.MissionAbort(this, character, mission);
            }

            currentMission = mission;
            currentMission.MissionStart(this, character);
        }
    }
Ejemplo n.º 7
0
 public void MissionEnd(AI_Mission_Base mission, bool result)
 {
     currentMission = null;
     GetNewMission();
 }
Ejemplo n.º 8
0
 public override void ActionStart(AI_Mission_Base mission, AI_Base brain, Character_Base character)
 {
     base.ActionStart(mission, brain, character);
     Check(character);
 }
Ejemplo n.º 9
0
 public virtual void ActionStart(AI_Mission_Base mission, AI_Base brain, Character_Base character)
 {
     Mission = mission;
 }
Ejemplo n.º 10
0
 public override void ActionStart(AI_Mission_Base mission, AI_Base brain, Character_Base character)
 {
     base.ActionStart(mission, brain, character);
     timer = MinDuration;
 }
 public override void ActionStart(AI_Mission_Base mission, AI_Base brain, Character_Base character)
 {
     base.ActionStart(mission, brain, character);
     perception = character.GetComponentInChildren <AIPerception>();
     Character  = character;
 }
Ejemplo n.º 12
0
 private void Start()
 {
     currentMission = Instantiate(currentMission);
     currentMission.MissionStart(this, character);
 }
Ejemplo n.º 13
0
 public override void ActionStart(AI_Mission_Base mission, AI_Base brain, Character_Base character)
 {
     base.ActionStart(mission, brain, character);
     character.JumpStart(character.transform.position, Duration, 0.75f, "");
 }
 public virtual void MissionAbort(AI_Base brain, Character_Base character, AI_Mission_Base newMission)
 {
     currentAction.ActionInterrupt(brain, character);
     BeforeExit();
 }
Ejemplo n.º 15
0
 public virtual void MissionAbort(AI_Base brain, Character_Base character, AI_Mission_Base newMission)
 {
 }