Пример #1
0
 void DamagePlayer()
 {
     PlayerManager.p_instance.p_health -= 10;
     PlayerHealthBar.SetHealthBarValue(PlayerHealthBar.GetHealthBarValue() - 0.10f);
     if (PlayerManager.p_instance.p_health <= 0)
     {
         OnPlayerDeath();
     }
 }
Пример #2
0
 void HealPlayer()
 {
     PlayerManager.p_instance.p_health += 5;
     if (PlayerManager.p_instance.p_health >= 100)
     {
         PlayerManager.p_instance.p_health = 100;
     }
     PlayerHealthBar.SetHealthBarValue(PlayerHealthBar.GetHealthBarValue() + .05f);
 }