private void Awake() { agent = GetComponent <aAgent>(); anim = GetComponentInChildren <Animator> (); patrolState = new PatrolState(this); chaseState = new ChaseState(this); currentState = patrolState; }
private void Awake() { agent = GetComponent <aAgent>(); idleState = new IdleState(this); walkState = new WalkState(this); aggroState = new AggroState(this); currentState = idleState; destination = FindObjectOfType <Castle> ().transform; }