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 <Health>(); 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; targetPlayer = GameObject.FindGameObjectWithTag("Player").transform; if (targetPlayer == null) { Debug.Log("Player not found"); return; } else { targetPlayer = GameObject.FindGameObjectWithTag("Player").transform; } }
private int count; // The number of colliders present that should open the doors. void Awake () { // Setting up the references. anim = GetComponent<Animator>(); hash = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneHashIDs>(); player = GameObject.FindGameObjectWithTag(DoneTags.player); playerInventory = player.GetComponent<DonePlayerInventory>(); }
private int count; // The number of colliders present that should open the doors. void Awake() { // Setting up the references. anim = GetComponent <Animator>(); hash = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneHashIDs>(); player = GameObject.FindGameObjectWithTag(DoneTags.player); playerInventory = player.GetComponent <DonePlayerInventory>(); }
private DoneHashIDs hash; // Reference to the HashIDs. void Awake () { // Setting up the references. anim = GetComponent<Animator>(); hash = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneHashIDs>(); // Set the weight of the shouting layer to 1. anim.SetLayerWeight(1, 1f); }
private bool playerDead; // A bool to show if the player is dead or not. void Awake () { // Setting up the references. anim = GetComponent<Animator>(); playerMovement = GetComponent<DonePlayerMovement>(); hash = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneHashIDs>(); sceneFadeInOut = GameObject.FindGameObjectWithTag(DoneTags.fader).GetComponent<DoneSceneFadeInOut>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneLastPlayerSighting>(); }
private DoneHashIDs hash; // Reference to the HashIDs. void Awake() { // Setting up the references. anim = GetComponent <Animator>(); hash = GameObject.FindGameObjectWithTag(UnityTags.GameController).GetComponent <DoneHashIDs>(); // Set the weight of the shouting layer to 1. anim.SetLayerWeight(1, 1f); }
private bool playerDead; // A bool to show if the player is dead or not. void Awake() { // Setting up the references. anim = GetComponent <Animator>(); playerMovement = GetComponent <DonePlayerMovement>(); hash = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneHashIDs>(); sceneFadeInOut = GameObject.FindGameObjectWithTag(DoneTags.fader).GetComponent <DoneSceneFadeInOut>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneLastPlayerSighting>(); }
private float timer; // Timer to determine when the lift moves and when the level ends. void Awake() { // Setting up references. player = GameObject.FindGameObjectWithTag(DoneTags.player); playerAnim = player.GetComponent <Animator>(); hash = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneHashIDs>(); camMovement = Camera.main.gameObject.GetComponent <DoneCameraMovement>(); sceneFadeInOut = GameObject.FindGameObjectWithTag(DoneTags.fader).GetComponent <DoneSceneFadeInOut>(); liftDoorsTracking = GetComponent <DoneLiftDoorsTracking>(); }
private float timer; // Timer to determine when the lift moves and when the level ends. void Awake () { // Setting up references. player = GameObject.FindGameObjectWithTag(DoneTags.player); playerAnim = player.GetComponent<Animator>(); hash = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneHashIDs>(); camMovement = Camera.main.gameObject.GetComponent<DoneCameraMovement>(); sceneFadeInOut = GameObject.FindGameObjectWithTag(DoneTags.fader).GetComponent<DoneSceneFadeInOut>(); liftDoorsTracking = GetComponent<DoneLiftDoorsTracking>(); }
private DoneHashIDs hash; // Reference to the HashIDs. void Awake() { // Setting up the references. _rigidbody = GetComponent <Rigidbody>(); _audio = GetComponent <AudioSource>(); anim = GetComponent <Animator>(); hash = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneHashIDs>(); // Set the weight of the shouting layer to 1. anim.SetLayerWeight(1, 1f); }
void Awake() { anim = GetComponent<Animator>(); agent = GetComponent<NavMeshAgent>(); opticSphereCol = GetComponent<SphereCollider>(); playerGameObject = GameObject.FindGameObjectWithTag(DoneTags.player); hash = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneHashIDs>(); animSetup = new AnimatorSetup(anim, hash); patrolIndex = 0; }
// 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>(); }
void Awake() { seeker = GetComponent<Seeker>(); //Start a new path to the targetPosition, return the result to the OnPathComplete function seeker.StartPath (transform.position,targetPosition.localPosition, OnPathComplete); // Setting up the references. anim = GetComponent<Animator>(); hash = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneHashIDs>(); // Set the weight of the shouting layer to 1. anim.SetLayerWeight(1, 1f); }
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 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.GetComponent<Light>(); // col = GetComponent<SphereCollider>(); player = GameObject.FindGameObjectWithTag(DoneTags.player).transform; playerHealth = player.gameObject.GetComponent<Health>(); 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 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 DoneAnimatorSetup animSetup; // An instance of the AnimatorSetup helper class. void Awake () { // Setting up the references. player = GameObject.FindGameObjectWithTag(DoneTags.player).transform; enemySight = GetComponent<DoneEnemySight>(); nav = GetComponent<NavMeshAgent>(); anim = GetComponent<Animator>(); hash = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneHashIDs>(); // Making sure the rotation is controlled by Mecanim. nav.updateRotation = false; // Creating an instance of the AnimatorSetup class and calling it's constructor. animSetup = new DoneAnimatorSetup(anim, hash); // Set the weights for the shooting and gun layers to 1. anim.SetLayerWeight(1, 1f); anim.SetLayerWeight(2, 1f); // We need to convert the angle for the deadzone from degrees to radians. deadZone *= Mathf.Deg2Rad; }
private DoneAnimatorSetup animSetup; // An instance of the AnimatorSetup helper class. void Awake() { // Setting up the references. player = GameObject.FindGameObjectWithTag(DoneTags.player).transform; enemySight = GetComponent <EnemyZombieSight>(); nav = GetComponent <UnityEngine.AI.NavMeshAgent>(); anim = GetComponent <Animator>(); hash = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneHashIDs>(); // Making sure the rotation is controlled by Mecanim. // nav.updateRotation = false; // Creating an instance of the AnimatorSetup class and calling it's constructor. // animSetup = new DoneAnimatorSetup(anim, hash); // Set the weights for the shooting and gun layers to 1. //anim.SetLayerWeight(1, 1f); //anim.SetLayerWeight(2, 1f); // We need to convert the angle for the deadzone from degrees to radians. // deadZone *= Mathf.Deg2Rad; }
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; } } }
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<Health>(); 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; targetPlayer = GameObject.FindGameObjectWithTag("Player").transform; if (targetPlayer == null) { Debug.Log("Player not found"); return; } else targetPlayer = GameObject.FindGameObjectWithTag("Player").transform; }
private DoneHashIDs hash; // Reference to the HashIDs script. // Constructor public DoneAnimatorSetup(Animator animator, DoneHashIDs hashIDs) { anim = animator; hash = hashIDs; }
// Constructor public AnimatorSetup(Animator animator, DoneHashIDs hashIDs) { anim = animator; hash = hashIDs; }