Heroes_of_Hiis/Assets/Project Files/Scripts/JoonasP/PlayerInfo.cs

36 lines
663 B
C#
Raw Normal View History

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerInfo : MonoBehaviour
{
private int health;
private int essence_basic;
2022-04-11 15:56:51 +00:00
//Add elemental essences?
private void Awake()
{
health = 5;
essence_basic = 0;
}
public void AddHealth(int value)
{
health += value;
if (health <= 0)
{
2022-04-11 15:56:51 +00:00
Debug.Log("NO HEALTH REMAINING");
}
}
public void AddEssenceBasic(int value)
{
if (essence_basic + value < 0)
{
2022-04-11 15:56:51 +00:00
Debug.LogError("NOT ENOUGH ESSENCE");
}
else essence_basic += value;
}
}