private void Awake()
    {
        agent = GetComponent <aAgent>();
        anim  = GetComponentInChildren <Animator> ();

        patrolState = new PatrolState(this);
        chaseState  = new ChaseState(this);

        currentState = patrolState;
    }
Beispiel #2
0
    private void Awake()
    {
        agent = GetComponent <aAgent>();

        idleState  = new IdleState(this);
        walkState  = new WalkState(this);
        aggroState = new AggroState(this);

        currentState = idleState;

        destination = FindObjectOfType <Castle> ().transform;
    }