Fix: Health Manager

Fixed an issue with health manager not responding properly to zero potions
This commit is contained in:
2025-09-04 01:54:39 +02:00
parent 63fede11cb
commit 3b07854bd1
3 changed files with 8 additions and 12 deletions

View File

@@ -14,6 +14,7 @@ public class PlayerSkillHandler: MonoBehaviour
private Dictionary<PlayerSkillTree.Skills, float> cooldowns;
private Dictionary<PlayerSkillTree.Skills, float> cooldownsActivated;
private PlayerSkillTree playerSkillTree;
private HealthManager healthManager;
private CharacterController controller;
@@ -25,6 +26,7 @@ public class PlayerSkillHandler: MonoBehaviour
cooldownsActivated = new Dictionary<PlayerSkillTree.Skills, float>();
controller = GetComponent<CharacterController>();
playerSkillTree = PlayerSkillTree.Instance;
healthManager = GetComponent<HealthManager>();
AssignCooldowns();
}
@@ -45,6 +47,7 @@ public class PlayerSkillHandler: MonoBehaviour
if (playerSkillTree.TryUsePotion(PotionHandler.PotionType.HealthBig))
{
Debug.Log("Potion used!");
healthManager.ModifyHealth(10);
}
else
{