montzions ui pausenmenü ui lebns ui nachladen pausen menü neues digsein
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using UnityEngine;
|
||||
using TMPro; // WICHTIG: Erforderlich für TextMeshPro!
|
||||
|
||||
public class AmmoUI : MonoBehaviour
|
||||
{
|
||||
[Header("Referenzen")]
|
||||
[Tooltip("Ziehe hier dein TextMeshPro Text-Objekt rein")]
|
||||
public TextMeshProUGUI ammoText;
|
||||
|
||||
[Tooltip("Ziehe hier das Objekt mit deinem WeaponReload-Skript rein")]
|
||||
public WeaponReload weapon;
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (ammoText != null && weapon != null)
|
||||
{
|
||||
// Zeigt z. B. "30 / 30" im Textfeld an
|
||||
ammoText.text = weapon.currentAmmo + " / " + weapon.maxAmmo;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user