GameOver Overlay ist komplett fertig und funktional, später ggf. noch änderungen an info.Text
This commit is contained in:
@@ -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");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,10 @@ using UnityEngine;
|
||||
|
||||
public class InventoryData
|
||||
{
|
||||
|
||||
//vielleicht standardHealth, standardEnergy einbauen
|
||||
|
||||
|
||||
// energy
|
||||
public int energy;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user