MIF_E31221263/Assets/Scripts/Inventory/Items/ItemHealthPotion.cs

19 lines
478 B
C#

using UnityEngine;
[CreateAssetMenu(fileName = "ItemHealthPotion", menuName = "Items/Health Potion")]
public class ItemHealthPotion : InventoryItem
{
[Header("Config")]
public float HealthValue;
public override bool UseItem()
{
if (GameManager.Instance.Player.PlayerHealth.CanRestoreHealth())
{
GameManager.Instance.Player.PlayerHealth.RestoreHealth(HealthValue);
return true;
}
return false;
}
}