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

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
@@ -11,6 +11,7 @@ public class BattleManager : MonoBehaviour
[Header("UI 연결 (선택 사항)")]
public TMPro.TMP_InputField skillInputField; // Canvas에 배치한 텍스트 입력창
public UnityEngine.UI.Button attackButton; // Canvas에 배치한 공격 버튼
public TMPro.TextMeshProUGUI skillResultText; // 스킬 연성 결과 및 설명 출력용 텍스트 UI 추가 ⭐
private string debugInputText = "불화살을 힘차게 쏜다!"; // OnGUI 디버그용 입력 기본값
private string statusText = "스킬을 입력하여 전투를 시작하세요.";
@@ -34,6 +35,12 @@ public class BattleManager : MonoBehaviour
{
if (isAttacking) return;
// 버튼 클릭음 재생
if (SoundManager.Instance != null)
{
SoundManager.Instance.PlayButtonClick();
}
string prompt = "";
if (skillInputField != null)
{
@@ -92,9 +99,21 @@ public class BattleManager : MonoBehaviour
statusText = $"[연성 완료] 스킬: {response.name} | 피해: {response.damage}";
Debug.Log($"[Battle] 스킬 연성 성공: {response.name} (대미지: {response.damage}) - {response.description}");
// AI가 연성한 최종 스킬 정보를 화면상 텍스트 UI에 실시간 갱신 출력합니다.
if (skillResultText != null)
{
skillResultText.text = $"스킬 연성 성공: {response.name} (대미지: {response.damage})\n- {response.description}";
}
// 2. 플레이어 공격 애니메이션 및 적 타격 처리
if (player != null && player.hp > 0)
{
// 플레이어 휘두르기 공격음 재생
if (SoundManager.Instance != null)
{
SoundManager.Instance.PlayAttackSwing();
}
Animator pAnim = player.GetComponentInChildren<Animator>();
if (pAnim != null)
{