사운드 추가 및 리소스 깨지는 문제 수정

This commit is contained in:
김민구
2026-07-08 05:36:12 +09:00
parent 60e65a4c7d
commit 6e641be1c7
29 changed files with 472 additions and 119 deletions
+23 -2
View File
@@ -138,7 +138,15 @@ public class Player : MonoBehaviour
return;
}
InputContoller.UpdateInput(ref _inputs);
// 배틀 스테이지 씬에서는 이동 입력을 무시하여 움직이지 못하게 차단합니다 (채팅 공격 전용)
if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == "battleStage")
{
_inputs.PlayerMove = Vector2.zero;
}
else
{
InputContoller.UpdateInput(ref _inputs);
}
// 좌우 방향 전환 (Flip)
if (_inputs.PlayerMove.x < 0f && isFacingRight)
@@ -175,7 +183,8 @@ public class Player : MonoBehaviour
{
if (rb == null) return;
if (hp <= 0)
// 사망 상태이거나 배틀 스테이지 씬일 경우 움직임 강제 정지
if (hp <= 0 || UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == "battleStage")
{
rb.linearVelocity = new Vector2(0f, rb.linearVelocity.y);
return;
@@ -206,12 +215,24 @@ public class Player : MonoBehaviour
{
if (hp <= 0)
{
// 1. 플레이어 전사 사운드 재생
if (SoundManager.Instance != null)
{
SoundManager.Instance.PlayPlayerDeath();
}
animator.SetTrigger("4_Death");
Debug.Log($"플레이어가 {attackerName}에 의해 사망했습니다.");
StartCoroutine(SendDeathReport(attackerName));
}
else
{
// 2. 플레이어 피격 사운드 재생
if (SoundManager.Instance != null)
{
SoundManager.Instance.PlayPunchHit();
}
animator.SetTrigger("3_Damaged");
}
}