GameOver Overlay ist komplett fertig und funktional, später ggf. noch änderungen an info.Text

This commit is contained in:
2026-02-16 15:30:57 +01:00
parent a7aac28d92
commit 1a775172fd
7 changed files with 2826 additions and 47 deletions

View File

@@ -6,6 +6,8 @@ public class ChangeHealth : MonoBehaviour
{
[Header("UI and HUD")]
[SerializeField] public int deathCounter;
[SerializeField] GameObject panel;
[SerializeField] TMP_Text healthHUD;
[SerializeField] public int standardHealth = 3;
@@ -24,6 +26,7 @@ public class ChangeHealth : MonoBehaviour
void Start()
{
deathCounter = 0;
inventory.Health = standardHealth;
Debug.Log(inventory.Health);
}
@@ -32,10 +35,7 @@ public class ChangeHealth : MonoBehaviour
{
healthHUD.text = inventory.Health.ToString();
if (inventory.Health <= 0)
{
Die();
}
}
public void GetHit() //MUSS NOCH MIT ENEMIES VERKNÜPFT WERDEN
@@ -47,15 +47,23 @@ public class ChangeHealth : MonoBehaviour
Debug.Log("Ouch, you bastard.");
if (inventory.Health <= 0)
{
Die();
}
}
public void Die()
{
deathCounter++;
Debug.Log(deathCounter);
end.CalculateCost();
//Time.timeScale = 0; //Wieder umlegen
end.recentDeath = true;
end.ShowDeathScreen();
Debug.Log("rest in pizza");
}

View File

@@ -4,6 +4,10 @@ using UnityEngine;
public class InventoryData
{
//vielleicht standardHealth, standardEnergy einbauen
// energy
public int energy;