public void addHealthPlayer(float bonusHealth) { HealthGlobeControl healhPlayer = GameObject.FindObjectOfType <HealthGlobeControl>(); this.maxHealthPoints += bonusHealth; this.HealthPoints += bonusHealth; healhPlayer.healthSlider.value = HealthPoints / maxHealthPoints; }
public void ResetLifePlayer() { if (CompareTag("Player")) { HealthPoints = maxHealthPoints; _animator.ResetTrigger("die"); _animator.Play("Locomotion"); IsDead = false; _capsuleCollider.enabled = true; _navMeshAgent.enabled = true; HealthGlobeControl healhPlayer = GameObject.FindObjectOfType <HealthGlobeControl>(); healhPlayer.healthSlider.value = 1; } }