montzions ui pausenmenü ui lebns ui nachladen pausen menü neues digsein
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
using UnityEngine;
|
||||
using TMPro; // Erforderlich für TextMeshPro
|
||||
|
||||
public class HealthUI : MonoBehaviour
|
||||
{
|
||||
[Header("Referenzen")]
|
||||
public TextMeshProUGUI healthText;
|
||||
public PlayerHealth playerHealth;
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (healthText != null && playerHealth != null)
|
||||
{
|
||||
// Zeigt z. B. "HP: 100 / 100" an
|
||||
healthText.text = "HP: " + playerHealth.currentHealth + " / " + playerHealth.maxHealth;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user