private int wayPointIndex; // A counter for the way point array. void Awake() { // Setting up the references. enemySight = GetComponent <DoneEnemySight>(); nav = GetComponent <NavMeshAgent>(); player = GameObject.FindGameObjectWithTag(DoneTags.player).transform; playerHealth = player.GetComponent <DonePlayerHealth>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneLastPlayerSighting>(); }
private int wayPointIndex; // A counter for the way point array. void Awake () { // Setting up the references. enemySight = GetComponent<DoneEnemySight>(); nav = GetComponent<NavMeshAgent>(); player = GameObject.FindGameObjectWithTag(DoneTags.player).transform; playerHealth = player.GetComponent<DonePlayerHealth>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneLastPlayerSighting>(); }
void Awake() { // Setting up the references. enemySight = GetComponent <EnemyZombieSight>(); nav = GetComponent <UnityEngine.AI.NavMeshAgent>(); player = GameObject.FindGameObjectWithTag(DoneTags.player).transform; playerHealth = player.GetComponent <DonePlayerHealth>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneLastPlayerSighting>(); enemyZombieAttack = GetComponentInChildren <EnemyZombieAttack>(); }
private int wayPointIndex; // A counter for the way point array. #endregion Fields #region Methods void Awake() { // Setting up the references. enemySight = GetComponent<DoneEnemySight>(); nav = GetComponent<NavMeshAgent>(); player = GameObject.FindGameObjectWithTag(DoneTags.player).transform; playerHealth = player.GetComponent<DonePlayerHealth>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneLastPlayerSighting>(); // initializing the current_behavior variable current_behavior = "Initializing"; }
// TEST REMOVE UNLESS CONFIRMED. // Collider m_Collider; // Start is called before the first frame update void Awake() { //gameObject.GetComponentInParent(typeof(HingeJoint)) as HingeJoint; //Animator anim = gameObject.GetComponentInParent <Animator>(); // anim = zombieMain.GetComponent<Animator>(); player = GameObject.FindGameObjectWithTag(DoneTags.player); playerHealth = player.GetComponent <DonePlayerHealth>(); hash = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneHashIDs>(); // TEST REMOVE UNLESS CONFIRMED. // m_Collider = GetComponent<Collider>(); }
private Vector3 previousSighting; // Where the player was sighted last frame. #endregion Fields #region Methods void Awake() { // Setting up the references. nav = GetComponent<NavMeshAgent>(); col = GetComponent<SphereCollider>(); anim = GetComponent<Animator>(); //lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneLastPlayerSighting>(); player = GameObject.FindGameObjectWithTag(DoneTags.player); playerAnim = player.GetComponent<Animator>(); playerHealth = player.GetComponent<DonePlayerHealth>(); hash = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneHashIDs>(); // Set the personal sighting and the previous sighting to the reset position. personalLastSighting = lastPlayerSighting.resetPosition; previousSighting = lastPlayerSighting.resetPosition; }
private Vector3 previousSighting; // Where the player was sighted last frame. void Awake() { // Setting up the references. nav = GetComponent <NavMeshAgent>(); col = GetComponent <SphereCollider>(); anim = GetComponent <Animator>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneLastPlayerSighting>(); player = GameObject.FindGameObjectWithTag(DoneTags.player); playerAnim = player.GetComponent <Animator>(); playerHealth = player.GetComponent <DonePlayerHealth>(); hash = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneHashIDs>(); // Set the personal sighting and the previous sighting to the reset position. personalLastSighting = lastPlayerSighting.resetPosition; previousSighting = lastPlayerSighting.resetPosition; }
private float scaledDamage; // Amount of damage that is scaled by the distance from the player. void Awake() { // Setting up the references. anim = GetComponent <Animator>(); laserShotLine = GetComponentInChildren <LineRenderer>(); laserShotLight = laserShotLine.gameObject.GetComponent <Light>(); col = GetComponent <SphereCollider>(); player = GameObject.FindGameObjectWithTag(DoneTags.player).transform; playerHealth = player.gameObject.GetComponent <DonePlayerHealth>(); hash = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneHashIDs>(); // The line renderer and light are off to start. laserShotLine.enabled = false; laserShotLight.intensity = 0f; // The scaledDamage is the difference between the maximum and the minimum damage. scaledDamage = maximumDamage - minimumDamage; }
private bool shooting; // A bool to say whether or not the enemy is currently shooting. #endregion Fields #region Methods void Awake() { // Setting up the references. anim = GetComponent<Animator>(); laserShotLine = GetComponentInChildren<LineRenderer>(); laserShotLight = laserShotLine.gameObject.light; col = GetComponent<SphereCollider>(); player = GameObject.FindGameObjectWithTag(DoneTags.player).transform; playerHealth = player.gameObject.GetComponent<DonePlayerHealth>(); hash = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneHashIDs>(); // The line renderer and light are off to start. laserShotLine.enabled = false; laserShotLight.intensity = 0f; // The scaledDamage is the difference between the maximum and the minimum damage. scaledDamage = maximumDamage - minimumDamage; }
void Awake() { counter = 0; incorrect_counter = 0; filename = "collision_eval.txt"; time_stat_file = "time_stats.txt"; write_once = false; self = this.transform; self_ai = this.GetComponent<DoneEnemyAI>(); self_sight = this.GetComponent<DoneEnemySight>(); player = GameObject.FindGameObjectWithTag(DoneTags.player); player_health = player.GetComponent<DonePlayerHealth>(); animator_hash = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneHashIDs>(); GameObject[] enemies = GameObject.FindGameObjectsWithTag(DoneTags.enemy); for( int i = 0; i < enemies.Length; i++) { if ( self.transform == enemies[i].transform) { enemy_num = i + 1; } } }