From a755d4569afd2b563562a8229f373e499a7a5847 Mon Sep 17 00:00:00 2001 From: Mingu Kim Date: Sat, 1 Mar 2025 22:25:21 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A4=91=EA=B0=84=20=EB=AA=AC=EC=8A=A4?= =?UTF-8?q?=ED=84=B0=20=EC=96=91=EC=AA=BD=EC=97=90=EC=84=9C=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=EB=90=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Gameton/Scripts/Monster/MonsterSpawner.cs | 32 +++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs b/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs index 0dea916a..659fd58f 100644 --- a/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs +++ b/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs @@ -107,13 +107,33 @@ namespace TON private void SpawnBossMonster() { - // 랜덤한 스폰 포인트 선택 - int spawnPointIndex = Random.Range(0, spawnPoints.Length); GameObject bossPrefab = GetBossPrefabForWave(currentWave); - - GameObject boss = Instantiate(bossPrefab, spawnPoints[spawnPointIndex].position, Quaternion.identity); - monsterPool.Add(boss); - activeMonsters.Add(boss); + + // 스폰 포인트 배열의 처음과 마지막 위치에 보스 몬스터 생성 + if (spawnPoints.Length >= 2) + { + // 왼쪽 스폰 포인트 + GameObject leftBoss = Instantiate(bossPrefab, spawnPoints[0].position, Quaternion.identity); + monsterPool.Add(leftBoss); + activeMonsters.Add(leftBoss); + + // 오른쪽 스폰 포인트 + GameObject rightBoss = Instantiate(bossPrefab, spawnPoints[spawnPoints.Length - 1].position, Quaternion.identity); + monsterPool.Add(rightBoss); + activeMonsters.Add(rightBoss); + } + else + { + Debug.LogError("스폰 포인트가 2개 이상 필요합니다."); + } + + // // 랜덤한 스폰 포인트 선택 + // int spawnPointIndex = Random.Range(0, spawnPoints.Length); + // GameObject bossPrefab = GetBossPrefabForWave(currentWave); + // + // GameObject boss = Instantiate(bossPrefab, spawnPoints[spawnPointIndex].position, Quaternion.identity); + // monsterPool.Add(boss); + // activeMonsters.Add(boss); // 보스 웨이브에서는 자동으로 다음 웨이브로 넘어가지 않음 // 보스가 죽으면 Update에서 체크하여 다음 웨이브로 넘어감