47 lines
848 B
C#
47 lines
848 B
C#
using System.Threading;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
public class HandleEnergy : MonoBehaviour
|
|
{
|
|
[Header("Values")]
|
|
|
|
[SerializeField] public int standardEnergy = 10;
|
|
[SerializeField] public int addEnergyValue = 2;
|
|
|
|
[Header("UI and HUD")]
|
|
|
|
|
|
[SerializeField] TMP_Text energyHUD;
|
|
|
|
[Header("ScriptPile")]
|
|
|
|
[SerializeField] GameObject scriptPile;
|
|
|
|
InventoryScript inventory;
|
|
GameOver end;
|
|
|
|
private void Awake()
|
|
{
|
|
inventory = scriptPile.GetComponent<InventoryScript>();
|
|
end = scriptPile.GetComponent<GameOver>(); //UNNÖTIG, BEI ENEGRY 0 IST JA KEIN GAMEOVER
|
|
}
|
|
|
|
void Start()
|
|
{
|
|
inventory.Energy = standardEnergy;
|
|
energyHUD.text = inventory.Energy.ToString();
|
|
}
|
|
|
|
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
public void LoseEnergy()
|
|
{
|
|
|
|
}
|
|
}
|