몬스터 스폰 카운트 기능 추가
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user