void Awake() { // Set up the references. player = GameObject.FindGameObjectWithTag("Player").transform; playerHealth = player.GetComponent <PlayerHealth> (); enemyHealth = GetComponent <EnemyHealth> (); navAgent = GetComponent <DungeonNavAgent>(); }
void Awake () { // Set up the references. player = GameObject.FindGameObjectWithTag ("Player").transform; playerHealth = player.GetComponent <PlayerHealth> (); enemyHealth = GetComponent <EnemyHealth> (); navAgent = GetComponent<DungeonNavAgent>(); }
protected override void Initialize() { capsule = GetComponent <CapsuleCollider>(); patrol = GetComponent <PatrolPath>(); agent = GetComponent <DungeonNavAgent>(); lastSighting = GetComponent <LastPlayerSighting>(); State startState = null; if (hasPatrolling) { startState = new AIStatePatrol(this); } else { startState = new AIStateIdle(this); } stateMachine.MoveTo(startState); }
protected override void Initialize() { capsule = GetComponent<CapsuleCollider>(); patrol = GetComponent<PatrolPath>(); agent = GetComponent<DungeonNavAgent>(); lastSighting = GetComponent<LastPlayerSighting>(); State startState = null; if (hasPatrolling) { startState = new AIStatePatrol(this); } else { startState = new AIStateIdle(this); } stateMachine.MoveTo(startState); }
// Use this for initialization void Start() { agent = GetComponent <DungeonNavAgent>(); }
// Use this for initialization void Start () { agent = GetComponent<DungeonNavAgent>(); }