Initial commit

This commit is contained in:
2026-06-18 16:37:02 +01:00
commit c8e34b8ed8
6996 changed files with 4355895 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
using UnityEngine;
using TMPro; // Required for TextMeshPro
public class UIManager : MonoBehaviour
{
public static UIManager Instance { get; private set; }
[Header("Player UI")]
public TextMeshProUGUI healthText;
[Header("Wave UI")]
public TextMeshProUGUI waveText;
public TextMeshProUGUI enemiesLeftText;
void Awake()
{
// Simple Singleton setup for the prototype
if (Instance == null)
{
Instance = this;
}
else
{
Destroy(gameObject);
}
}
public void UpdatePlayerHealth(int currentHealth, int maxHealth)
{
if (healthText != null)
{
healthText.text = $"HP: {currentHealth} / {maxHealth}";
}
}
public void UpdateWaveProgress(int currentWave, int totalWaves)
{
if (waveText != null)
{
// If totalWaves is 0, it means endless mode
string totalString = totalWaves > 0 ? totalWaves.ToString() : "???";
waveText.text = $"Wave: {currentWave} / {totalString}";
}
}
public void UpdateEnemiesRemaining(int enemiesAlive)
{
if (enemiesLeftText != null)
{
enemiesLeftText.text = $"Enemies Left: {enemiesAlive}";
}
}
}