26 lines
734 B
C#
26 lines
734 B
C#
using UnityEngine;
|
|
using TMPro;
|
|
|
|
public class UIController : MonoBehaviour
|
|
{
|
|
public TextMeshProUGUI currentAmmoText, remainingAmmoText; // Reference to the ammo text UI element
|
|
//public TextMeshProUGUI healthText; // Reference to the health text UI element
|
|
|
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
public void UpdateAmmoText(int currentAmmo, int remainingAmmo)
|
|
{
|
|
currentAmmoText.text = currentAmmo.ToString(); // Update the current ammo text
|
|
remainingAmmoText.text = "/" + remainingAmmo.ToString(); // Update the remaining ammo text
|
|
}
|
|
}
|