몬스터 스폰 카운트 기능 추가

This commit is contained in:
Mingu Kim
2025-02-27 01:54:45 +09:00
parent 49ca624fa5
commit a227994ec7
2 changed files with 324 additions and 1 deletions

View File

@@ -1,6 +1,8 @@
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace TON
{
@@ -30,6 +32,9 @@ namespace TON
private List<GameObject> activeMonsters; // 현재 활성화된 몬스터 리스트
[SerializeField]
public TextMeshProUGUI waveCounter;
// Start is called before the first frame update
void Start()
{
@@ -159,7 +164,18 @@ namespace TON
private IEnumerator StartNextWaveWithDelay()
{
yield return new WaitForSeconds(nextWaveDelay);
float timer = nextWaveDelay;
while (timer > 0)
{
waveCounter.text = Mathf.CeilToInt(timer).ToString(); // 남은 시간 표시
timer -= Time.deltaTime;
yield return null;
}
// waveCounter.text = "0";
waveCounter.text = null;
isWaitingForNextWave = false;
StartNextWave();
}