스포너 10스테이지 이후 카운트 제거

This commit is contained in:
Mingu Kim
2025-03-01 21:54:37 +09:00
parent e6a2b638cf
commit 38289b8a9f

View File

@@ -89,7 +89,7 @@ namespace TON
activeMonsters.RemoveAll(monster => monster == null); activeMonsters.RemoveAll(monster => monster == null);
// 모든 몬스터가 죽었는지 확인하고 다음 웨이브 준비 // 모든 몬스터가 죽었는지 확인하고 다음 웨이브 준비
if (activeMonsters.Count == 0 && currentWave > 0 && currentWave < 11 && !isWaitingForNextWave) if (activeMonsters.Count == 0 && currentWave > 0 && !isWaitingForNextWave)
{ {
isWaitingForNextWave = true; isWaitingForNextWave = true;
StartCoroutine(StartNextWaveWithDelay()); StartCoroutine(StartNextWaveWithDelay());
@@ -264,10 +264,15 @@ namespace TON
private IEnumerator StartNextWaveWithDelay() private IEnumerator StartNextWaveWithDelay()
{ {
if (currentWave != 11 && GameObject.Find("TON.Player").GetComponentInChildren<CharacterBase>() != null) // 웨이브가 10이면 (즉, 10스테이지가 끝났으면) 또는 웨이브가 11이면 게임 종료 UI를 바로 보여줌
if (currentWave == 10 || currentWave == 11 || GameObject.Find("TON.Player").GetComponentInChildren<CharacterBase>() == null)
{
Invoke(nameof(ShowGameEndUI), 0.5f);
}
else
{ {
SoundManager.instance.BgSoundPlay(null); SoundManager.instance.BgSoundPlay(null);
float timer = nextWaveDelay; float timer = nextWaveDelay;
while (timer > 0) while (timer > 0)
@@ -277,16 +282,11 @@ namespace TON
yield return null; yield return null;
} }
// waveCounter.text = "0";
waveCounter.text = null; waveCounter.text = null;
isWaitingForNextWave = false; isWaitingForNextWave = false;
StartNextWave(); StartNextWave();
} }
else
{
Invoke(nameof(ShowGameEndUI), 0.5f);
}
} }
private void ShowGameEndUI() private void ShowGameEndUI()