Example #1
0
    private void Awake()
    {
        attackState = new AttackState(this);
        chaseState  = new ChaseState(this);
        patrolState = new PatrolState(this);

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

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

        currentState = patrolState;
    }
Example #3
0
 public StateContext(EnemyBehaviour enemy, DetectPlayer detect)
 {
     this.enemy   = enemy;
     this.detect  = detect;
     CurrentState = EnemyStates.Patrol;
 }