private void OnTriggerEnter(Collider other) { if (other.tag == "Player") { pathfinding.GetComponent <Pathfinding>().enabled = true; IsRunning(true); _sphereCollider.radius += 12; pathfinding.TargetPoint = other.transform; _healthAndEnergy = other.GetComponent <HealthAndEnergy>(); } }
private void Start() { Instance = this; lastHpBarFill = health; TimePassed = 0; anim = GetComponent <Animator>(); //playerAudio = GetComponent<AudioSource>(); //playerMovement = GetComponent<PlayerMovement>(); //playerShooting = GetComponentInChildren<PlayerShooting>(); // Set the initial health of the player. // currentHealth = startingHealth; }