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>();
        }
Example #3
0
        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);
		}
Example #5
0
 // Use this for initialization
 void Start()
 {
     agent = GetComponent <DungeonNavAgent>();
 }
		// Use this for initialization
		void Start () {
			agent = GetComponent<DungeonNavAgent>();
		}