HealthBar
This commit is contained in:
@@ -9,6 +9,10 @@ public class PlayerSkillTree
|
||||
|
||||
private static PlayerSkillTree _instance;
|
||||
private Dictionary<PotionHandler.PotionType, PotionHandler> potionHandlers = new Dictionary<PotionHandler.PotionType, PotionHandler>();
|
||||
private int health = 100;
|
||||
private int maxHealth = 100;
|
||||
|
||||
public int MaxHealth { get => maxHealth; set => maxHealth = value; }
|
||||
|
||||
public static PlayerSkillTree Instance
|
||||
{
|
||||
@@ -81,6 +85,25 @@ public class PlayerSkillTree
|
||||
return false;
|
||||
}
|
||||
|
||||
public int GetHealth() { return health; }
|
||||
|
||||
public void SetHealth(int value)
|
||||
{
|
||||
if(value + health > maxHealth)
|
||||
{
|
||||
health = maxHealth;
|
||||
return;
|
||||
}
|
||||
|
||||
if(health + value < 0)
|
||||
{
|
||||
health = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
health += value;
|
||||
}
|
||||
|
||||
|
||||
public bool IsSkillUnlocked(Skills skill)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user