Health and Energy Logic ausgeführt, GameOver und LevelTime Scripte angelegt, Timer (aber keinen krassen coolen) eingebaut
This commit is contained in:
@@ -4,30 +4,29 @@ using static UnityEngine.EventSystems.EventTrigger;
|
||||
|
||||
public class ChangeHealth : MonoBehaviour
|
||||
{
|
||||
[SerializeField] GameObject panel;
|
||||
[SerializeField] GameObject gameOverSceen;
|
||||
|
||||
|
||||
[Header("UI and HUD")]
|
||||
|
||||
[SerializeField] TMP_Text energyHUD;
|
||||
[SerializeField] GameObject panel;
|
||||
[SerializeField] TMP_Text healthHUD;
|
||||
[SerializeField] public int standardHealth = 3;
|
||||
|
||||
[Header("ScriptPile")]
|
||||
|
||||
InventoryScript inventory;
|
||||
GameOver end;
|
||||
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
inventory = panel.GetComponent<InventoryScript>();
|
||||
|
||||
end = panel.GetComponent<GameOver>();
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
energyHUD.text = inventory.Energy.ToString();
|
||||
inventory.Health = standardHealth;
|
||||
healthHUD.text = inventory.Health.ToString();
|
||||
|
||||
gameOverSceen.SetActive(false);
|
||||
|
||||
}
|
||||
|
||||
void Update()
|
||||
@@ -40,18 +39,17 @@ public class ChangeHealth : MonoBehaviour
|
||||
|
||||
public void GetHit()
|
||||
{
|
||||
|
||||
inventory.Health -= 1; //MAGIC NUMBER BITTE BEACHTEN
|
||||
}
|
||||
|
||||
|
||||
public void Die()
|
||||
{
|
||||
gameOverSceen.SetActive(true);
|
||||
Time.timeScale = 0;
|
||||
|
||||
end.ShowDeathScreen();
|
||||
}
|
||||
|
||||
public void NewChance()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user