Merge branch 'dev' of https://github.com/2aurore/Gameton-06 into dev
# Conflicts: # Gameton-06/Assets/Gameton/Scripts/Character/CharacterBase.cs
This commit is contained in:
@@ -43,6 +43,7 @@ namespace TON
|
|||||||
|
|
||||||
public AudioClip _attackSound;
|
public AudioClip _attackSound;
|
||||||
public AudioClip _deathSound;
|
public AudioClip _deathSound;
|
||||||
|
public AudioClip _hitSound;
|
||||||
|
|
||||||
public void Start()
|
public void Start()
|
||||||
{
|
{
|
||||||
@@ -283,6 +284,8 @@ namespace TON
|
|||||||
|
|
||||||
OnHPChanged?.Invoke(currentHP, maxHP);
|
OnHPChanged?.Invoke(currentHP, maxHP);
|
||||||
|
|
||||||
|
SoundManager.instance.SFXPlay("Hit", _hitSound);
|
||||||
|
|
||||||
// 체력이 0 아래로 떨어지고 현 상태가 IsAlive 일때만 동작하도록 함
|
// 체력이 0 아래로 떨어지고 현 상태가 IsAlive 일때만 동작하도록 함
|
||||||
if (currentHP <= 0f && prevHP > 0)
|
if (currentHP <= 0f && prevHP > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ namespace TON
|
|||||||
|
|
||||||
private CharacterBase _characterBase;
|
private CharacterBase _characterBase;
|
||||||
|
|
||||||
public AudioClip _attackSound;
|
// public AudioClip _attackSound;
|
||||||
public AudioClip _deathSound;
|
public AudioClip _deathSound;
|
||||||
public AudioClip _hitSound;
|
public AudioClip _hitSound;
|
||||||
|
|
||||||
@@ -186,7 +186,7 @@ namespace TON
|
|||||||
|
|
||||||
_characterBase.ApplyDamage(damage);
|
_characterBase.ApplyDamage(damage);
|
||||||
|
|
||||||
SoundManager.instance.SFXPlay("Attack", _attackSound);
|
// SoundManager.instance.SFXPlay("Attack", _attackSound);
|
||||||
// Debug.Log($" 몬스터 공격! 최종 데미지: {damage}"); // 데미지 출력
|
// Debug.Log($" 몬스터 공격! 최종 데미지: {damage}"); // 데미지 출력
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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());
|
||||||
@@ -107,13 +107,33 @@ namespace TON
|
|||||||
|
|
||||||
private void SpawnBossMonster()
|
private void SpawnBossMonster()
|
||||||
{
|
{
|
||||||
// 랜덤한 스폰 포인트 선택
|
|
||||||
int spawnPointIndex = Random.Range(0, spawnPoints.Length);
|
|
||||||
GameObject bossPrefab = GetBossPrefabForWave(currentWave);
|
GameObject bossPrefab = GetBossPrefabForWave(currentWave);
|
||||||
|
|
||||||
GameObject boss = Instantiate(bossPrefab, spawnPoints[spawnPointIndex].position, Quaternion.identity);
|
// 스폰 포인트 배열의 처음과 마지막 위치에 보스 몬스터 생성
|
||||||
monsterPool.Add(boss);
|
if (spawnPoints.Length >= 2)
|
||||||
activeMonsters.Add(boss);
|
{
|
||||||
|
// 왼쪽 스폰 포인트
|
||||||
|
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에서 체크하여 다음 웨이브로 넘어감
|
// 보스가 죽으면 Update에서 체크하여 다음 웨이브로 넘어감
|
||||||
@@ -264,10 +284,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,20 +302,17 @@ 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()
|
||||||
{
|
{
|
||||||
|
SoundManager.instance.BgSoundPlay(null);
|
||||||
|
StageManager.Singleton.SetWaveData(currentWave); // 웨이브 정보 전달.
|
||||||
UIManager.Show<GameWinUI>(UIList.GameWinUI);
|
UIManager.Show<GameWinUI>(UIList.GameWinUI);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user