void Awake() { character = transform; player = GameObject.FindWithTag ("Player").transform; lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneLastPlayerSighting>(); enemySight = GameObject.FindGameObjectWithTag("AIattack").GetComponent<EnemySight>(); }
void Awake() { dlps = GameObject.FindGameObjectWithTag("GameController").GetComponent <DoneLastPlayerSighting> (); currentHealth = startingHealth; hud = GameObject.FindGameObjectWithTag("UI").GetComponent <HUD> (); healthtrasform.fillAmount = currentHealth / startingHealth; }
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; } }
void Awake() { character = transform; player = GameObject.FindWithTag("Player").transform; lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneLastPlayerSighting>(); enemySight = GameObject.FindGameObjectWithTag("AIattack").GetComponent <EnemySight>(); }
private DoneLastPlayerSighting lastPlayerSighting; // Reference to the global last sighting of the player. void Awake() { // Setting up references. _renderer = GetComponent <Renderer>(); player = GameObject.FindGameObjectWithTag(DoneTags.player); 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() { character = motor.transform; player = GameObject.FindWithTag("Player").transform; ai = transform.parent.GetComponentInChildren <AI> (); lastPlayerSighting = GameObject.FindGameObjectWithTag("GameController").GetComponent <DoneLastPlayerSighting>(); enemySight = GetComponent <EnemySight>(); }
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 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 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>(); }
void Awake() { i = 0; alle = true; light = GameObject.Find("Directional light"); rotat = GameObject.Find("CamArmature"); col = GetComponent <SphereCollider>(); player = GameObject.FindGameObjectWithTag(DoneTags.player); lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneLastPlayerSighting>(); }
void Start() { i = 0; alle = true; col = GetComponent <SphereCollider>(); player = GameObject.FindGameObjectWithTag(DoneTags.player); lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneLastPlayerSighting>(); // rotat.transform.rotation = .... }
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>(); }
void Awake() { character = motor.transform; player = GameObject.FindWithTag ("Player").transform; ai = transform.parent.GetComponentInChildren<AI> (); if (blinkComponents.Length != 0) // FIX HERE changed from 'if (!blinkComponents.Length)' blinkComponents = transform.parent.GetComponentsInChildren<SelfIlluminationBlink> (); lastPlayerSighting = GameObject.FindGameObjectWithTag("GameController").GetComponent<DoneLastPlayerSighting>(); enemySight = GetComponent<EnemySight>(); }
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"; }
void Awake() { character = motor.transform; player = GameObject.FindWithTag("Player").transform; ai = transform.parent.GetComponentInChildren <AI> (); if (blinkComponents.Length != 0) // FIX HERE changed from 'if (!blinkComponents.Length)' { blinkComponents = transform.parent.GetComponentsInChildren <SelfIlluminationBlink> (); } lastPlayerSighting = GameObject.FindGameObjectWithTag("GameController").GetComponent <DoneLastPlayerSighting>(); enemySight = GetComponent <EnemySight>(); }
private int wayPointIndex = 0; // A counter for the way point array. void Awake() { // Setting up the references. HealthPack = GameObject.FindGameObjectWithTag("HealthPack").transform; enemySight = GetComponent <EnemySight>(); nav = GetComponent <UnityEngine.NavMeshAgent>(); player = GameObject.FindGameObjectWithTag(Tags.player).transform; playerHealth = player.GetComponent <PlayerHealth>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <DoneLastPlayerSighting>(); enemyShooting = GetComponent <EnemyShooting> (); for (wayPointIndex = 0; wayPointIndex < 4; wayPointIndex++) { patrolWayPoints[wayPointIndex] = new Vector3(Random.Range(0, 500), 0, Random.Range(0, 500)); } }
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 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; }
void Awake() { // Setting up the references. enemySight = GetComponent <DoneEnemySight>(); nav = GetComponent <NavMeshAgent>(); player = GameObject.FindGameObjectWithTag(DoneTags.player).transform; playerHealth = player.GetComponent <Health>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneLastPlayerSighting>(); if (bloodPrefab) { // if (damageEffectTransform == gameObject.transform) damageEffectTransform = transform; GameObject effect = Spawner.Spawn(bloodPrefab, Vector3.zero, Quaternion.identity); effect.transform.parent = damageEffectTransform; effect.transform.localPosition = Vector3.zero; damageEffect = effect.GetComponent <ParticleEmitter>(); Vector2 tempSize = new Vector2(GetComponent <Collider>().bounds.extents.x, GetComponent <Collider>().bounds.extents.z); colliderRadiusHeuristic = tempSize.magnitude * 0.5f; damageEffectCenterYOffset = GetComponent <Collider>().bounds.extents.y; } }
void Awake() { // Setting up the references. enemySight = GetComponent<DoneEnemySight>(); nav = GetComponent<NavMeshAgent>(); player = GameObject.FindGameObjectWithTag(DoneTags.player).transform; playerHealth = player.GetComponent<Health>(); lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneLastPlayerSighting>(); if (bloodPrefab) { // if (damageEffectTransform == gameObject.transform) damageEffectTransform = transform; GameObject effect = Spawner.Spawn(bloodPrefab, Vector3.zero, Quaternion.identity); effect.transform.parent = damageEffectTransform; effect.transform.localPosition = Vector3.zero; damageEffect = effect.GetComponent<ParticleEmitter>(); Vector2 tempSize = new Vector2(GetComponent<Collider>().bounds.extents.x, GetComponent<Collider>().bounds.extents.z); colliderRadiusHeuristic = tempSize.magnitude * 0.5f; damageEffectCenterYOffset = GetComponent<Collider>().bounds.extents.y; } }
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("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; }
void Awake() { lastPlayerSighting = GameObject.FindGameObjectWithTag("GameController").GetComponent<DoneLastPlayerSighting>(); enemySight = GetComponent<EnemySight>(); }
private DoneLastPlayerSighting lastPlayerSighting; // Reference to the global last sighting of the player. void Awake () { // Setting up the references. player = GameObject.FindGameObjectWithTag(DoneTags.player); lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent<DoneLastPlayerSighting>(); }
// Update is called once per frame void Start() { dlps = GameObject.FindGameObjectWithTag("GameController").GetComponent <DoneLastPlayerSighting> (); playerHealth = player.GetComponent <PlayerHealth> (); // enemySight = enemy.GetComponent<EnemySight> (); }
// Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag(DoneTags.player); lastPlayerSighting = GameObject.FindGameObjectWithTag(DoneTags.gameController).GetComponent <DoneLastPlayerSighting>(); }
void Awake() { lastPlayerSighting = GameObject.FindGameObjectWithTag("GameController").GetComponent <DoneLastPlayerSighting>(); enemySight = GetComponent <EnemySight>(); }
private DoneLastPlayerSighting lastPlayerSighting; // Reference to the global last sighting of the player. void Awake() { // Setting up the references. player = GameObject.FindGameObjectWithTag(UnityTags.Player); lastPlayerSighting = GameObject.FindGameObjectWithTag(UnityTags.GameController).GetComponent <DoneLastPlayerSighting>(); }
void Awake() { character = motor.transform; player = GameObject.FindWithTag ("Player").transform; ai = transform.parent.GetComponentInChildren<AI> (); lastPlayerSighting = GameObject.FindGameObjectWithTag("GameController").GetComponent<DoneLastPlayerSighting>(); enemySight = GetComponent<EnemySight>(); }