Esempio n. 1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "Player")
     {
         StopCoroutine(ForgetPlayer());
         if (aiCharacter.CurrentAIState != AIState.Chasing)
         {
             //Change AIState once a player is in the Vision field of vision
             aiCharacter.SetAIState(AIState.Chasing);
             GetComponentInParent <AIChasing>().SetTargetToChase(other.transform);
             //ChangeToLongerCone();
             shoutZone.AlertNearbyAgents(other.transform);
         }
         //the AI is still chasing, but checking to see if player is still within their visioncone
         else
         {
             GetComponentInParent <AIChasing>().IsTargetStillInView = true;
         }
     }
 }