Example #1
0
    // Use this for initialization
    void Start()
    {
        fOV    = GetComponent <FieldOfView>();
        patrol = GetComponent <PatrolV2>();
        chase  = GetComponent <Chase>();
        agent  = GetComponent <NavMeshAgent>();

        playerInSight = false;
        playerLost    = false;
        chasing       = false;
        waiting       = false;
        rotating      = false;
    }
Example #2
0
 // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
 override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     moveToPoint = animator.gameObject.GetComponent <MoveToPoint>();
     patrol      = animator.gameObject.GetComponent <PatrolV2>();
     animator.gameObject.GetComponent <EnemyAI>().RaisePatrolEvent();
 }