// Use this for initialization void Start() { timer = 0; GameObject player = GameObject.FindGameObjectWithTag("Player"); behaviorScript = player.GetComponent <IronManBehaviourScript>(); }
// Use this for initialization void Start() { startingPoint = GameObject.Find("starting-point"); endingPoint = GameObject.Find("ending-point"); GameObject player = GameObject.FindGameObjectWithTag("Player"); behaviorScript = player.GetComponent <IronManBehaviourScript>(); }
// Use this for initialization void Start() { anim = GetComponent <Animator>(); player = GameObject.FindGameObjectWithTag("Player"); enemyHealth = GetComponent <EnemyHealth>(); playerHealth = player.GetComponent <PlayerHealth> (); playerAnim = player.GetComponent <Animator> (); agent = GetComponent <NavMeshAgent>(); playerShoot = player.GetComponent <PlayerShoot>(); playerMovement = player.GetComponent <IronManBehaviourScript>(); }
public void TakeDamage(int amount, Vector3 hitPoint) { if (isDead) { return; } currentHealth -= amount; hitParticles.transform.position = hitPoint; hitParticles.Play(); if (currentHealth <= 0) { GameObject player = GameObject.FindGameObjectWithTag("Player"); IronManBehaviourScript playerScript = player.GetComponent <IronManBehaviourScript>(); playerScript.score += pointValueOnKill; audio.PlayOneShot(scoreUp, 1.0f); Death(); } PlayLaserSound(); }