From e6a2b638cfb247ee81a98e308328ef8e3a6ea949 Mon Sep 17 00:00:00 2001 From: Mingu Kim Date: Sat, 1 Mar 2025 21:48:15 +0900 Subject: [PATCH 1/6] =?UTF-8?q?=EB=AA=AC=EC=8A=A4=ED=84=B0=20=EA=B3=B5?= =?UTF-8?q?=EA=B2=A9=EC=9D=8C=20=EC=A0=9C=EA=B1=B0=20=EB=B0=8F=20=EC=BA=90?= =?UTF-8?q?=EB=A6=AD=ED=84=B0=20=ED=94=BC=EA=B2=A9=EC=9D=8C=20=EB=B3=B5?= =?UTF-8?q?=EA=B5=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gameton-06/Assets/Gameton/Scripts/Character/CharacterBase.cs | 4 +++- Gameton-06/Assets/Gameton/Scripts/Monster/MonsterBase.cs | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Gameton-06/Assets/Gameton/Scripts/Character/CharacterBase.cs b/Gameton-06/Assets/Gameton/Scripts/Character/CharacterBase.cs index 866118cf..d4c51a0f 100644 --- a/Gameton-06/Assets/Gameton/Scripts/Character/CharacterBase.cs +++ b/Gameton-06/Assets/Gameton/Scripts/Character/CharacterBase.cs @@ -43,7 +43,8 @@ namespace TON public AudioClip _attackSound; public AudioClip _deathSound; - + public AudioClip _hitSound; + public void Start() { animator = GetComponent(); @@ -261,6 +262,7 @@ namespace TON if (damage < 10) { animator.SetTrigger("Hit Trigger"); + SoundManager.instance.SFXPlay("Hit", _hitSound); } } } diff --git a/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterBase.cs b/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterBase.cs index c91ad0f9..62d7c3c7 100644 --- a/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterBase.cs +++ b/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterBase.cs @@ -41,7 +41,7 @@ namespace TON private CharacterBase _characterBase; - public AudioClip _attackSound; + // public AudioClip _attackSound; public AudioClip _deathSound; public AudioClip _hitSound; @@ -186,7 +186,7 @@ namespace TON _characterBase.ApplyDamage(damage); - SoundManager.instance.SFXPlay("Attack", _attackSound); + // SoundManager.instance.SFXPlay("Attack", _attackSound); // Debug.Log($" 몬스터 공격! 최종 데미지: {damage}"); // 데미지 출력 } From 38289b8a9fba0d843413fc074e32a2e961ca6e08 Mon Sep 17 00:00:00 2001 From: Mingu Kim Date: Sat, 1 Mar 2025 21:54:37 +0900 Subject: [PATCH 2/6] =?UTF-8?q?=EC=8A=A4=ED=8F=AC=EB=84=88=2010=EC=8A=A4?= =?UTF-8?q?=ED=85=8C=EC=9D=B4=EC=A7=80=20=EC=9D=B4=ED=9B=84=20=EC=B9=B4?= =?UTF-8?q?=EC=9A=B4=ED=8A=B8=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Gameton/Scripts/Monster/MonsterSpawner.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs b/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs index 4a4b7b9d..d519c2b0 100644 --- a/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs +++ b/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs @@ -89,7 +89,7 @@ namespace TON activeMonsters.RemoveAll(monster => monster == null); // 모든 몬스터가 죽었는지 확인하고 다음 웨이브 준비 - if (activeMonsters.Count == 0 && currentWave > 0 && currentWave < 11 && !isWaitingForNextWave) + if (activeMonsters.Count == 0 && currentWave > 0 && !isWaitingForNextWave) { isWaitingForNextWave = true; StartCoroutine(StartNextWaveWithDelay()); @@ -264,10 +264,15 @@ namespace TON private IEnumerator StartNextWaveWithDelay() { - if (currentWave != 11 && GameObject.Find("TON.Player").GetComponentInChildren() != null) + // 웨이브가 10이면 (즉, 10스테이지가 끝났으면) 또는 웨이브가 11이면 게임 종료 UI를 바로 보여줌 + if (currentWave == 10 || currentWave == 11 || GameObject.Find("TON.Player").GetComponentInChildren() == null) + { + Invoke(nameof(ShowGameEndUI), 0.5f); + } + else { SoundManager.instance.BgSoundPlay(null); - + float timer = nextWaveDelay; while (timer > 0) @@ -277,16 +282,11 @@ namespace TON yield return null; } - // waveCounter.text = "0"; waveCounter.text = null; isWaitingForNextWave = false; StartNextWave(); } - else - { - Invoke(nameof(ShowGameEndUI), 0.5f); - } } private void ShowGameEndUI() From 0cfb09a039f90726ac15e11fd71dc1a90dd075a5 Mon Sep 17 00:00:00 2001 From: Mingu Kim Date: Sat, 1 Mar 2025 22:04:23 +0900 Subject: [PATCH 3/6] =?UTF-8?q?10=EC=8A=A4=ED=85=8C=EC=9D=B4=EC=A7=80=20?= =?UTF-8?q?=EC=A2=85=EB=A3=8C=20=ED=9B=84=20BGM=20=EC=A2=85=EB=A3=8C=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs b/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs index d519c2b0..46d27790 100644 --- a/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs +++ b/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs @@ -291,6 +291,7 @@ namespace TON private void ShowGameEndUI() { + SoundManager.instance.BgSoundPlay(null); UIManager.Show(UIList.GameWinUI); } } From 3896301f124a670d26929e2252d6b34e8fd7d8d5 Mon Sep 17 00:00:00 2001 From: Mingu Kim Date: Sat, 1 Mar 2025 22:06:06 +0900 Subject: [PATCH 4/6] =?UTF-8?q?=EB=AA=AC=EC=8A=A4=ED=84=B0=20=ED=94=BC?= =?UTF-8?q?=EA=B2=A9=20=EC=82=AC=EC=9A=B4=EB=93=9C=20=ED=95=9C=EB=B2=88?= =?UTF-8?q?=EB=A7=8C=20=EC=9E=AC=EC=83=9D=EB=90=98=EB=8A=94=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gameton-06/Assets/Gameton/Scripts/Character/CharacterBase.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Gameton-06/Assets/Gameton/Scripts/Character/CharacterBase.cs b/Gameton-06/Assets/Gameton/Scripts/Character/CharacterBase.cs index d4c51a0f..3d1f0972 100644 --- a/Gameton-06/Assets/Gameton/Scripts/Character/CharacterBase.cs +++ b/Gameton-06/Assets/Gameton/Scripts/Character/CharacterBase.cs @@ -248,6 +248,8 @@ namespace TON currentHP = Mathf.Clamp(currentHP, 0, maxHP); OnHPChanged?.Invoke(currentHP, maxHP); + + SoundManager.instance.SFXPlay("Hit", _hitSound); // 체력이 0 아래로 떨어지고 현 상태가 IsAlive 일때만 동작하도록 함 if (currentHP <= 0f && prevHP > 0) @@ -255,14 +257,13 @@ namespace TON Dead(); SoundManager.instance.SFXPlay("Death", _deathSound); } - + // 체력이 0 보다 클때만 피격 모션 실행 if (currentHP > 0) { if (damage < 10) { animator.SetTrigger("Hit Trigger"); - SoundManager.instance.SFXPlay("Hit", _hitSound); } } } From 82a4ce835906b68d0cb3dae9a6fb0c589f66a7cf Mon Sep 17 00:00:00 2001 From: Mingu Kim Date: Sat, 1 Mar 2025 22:10:48 +0900 Subject: [PATCH 5/6] =?UTF-8?q?=EC=9B=A8=EC=9D=B4=EB=B8=8C=20=EC=B5=9C?= =?UTF-8?q?=EC=A2=85=20=EC=99=84=EB=A3=8C=20=EC=8B=9C=20=EC=9B=A8=EC=9D=B4?= =?UTF-8?q?=EB=B8=8C=20=EC=B9=B4=EC=9A=B4=ED=8A=B8=20=EC=A0=95=EC=83=81=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9=EB=90=98=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs b/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs index 46d27790..0dea916a 100644 --- a/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs +++ b/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterSpawner.cs @@ -292,6 +292,7 @@ namespace TON private void ShowGameEndUI() { SoundManager.instance.BgSoundPlay(null); + StageManager.Singleton.SetWaveData(currentWave); // 웨이브 정보 전달. UIManager.Show(UIList.GameWinUI); } } From a755d4569afd2b563562a8229f373e499a7a5847 Mon Sep 17 00:00:00 2001 From: Mingu Kim Date: Sat, 1 Mar 2025 22:25:21 +0900 Subject: [PATCH 6/6] =?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에서 체크하여 다음 웨이브로 넘어감