Health and Energy Logic ausgeführt, GameOver und LevelTime Scripte angelegt, Timer (aber keinen krassen coolen) eingebaut
This commit is contained in:
46
Assets/Scripts/Player/HandleEnergy.cs
Normal file
46
Assets/Scripts/Player/HandleEnergy.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user