Initial commit: Unity 프로젝트 셋업 + 다이얼로그 시스템 이전

This commit is contained in:
2026-07-04 15:38:52 +09:00
commit 4d94878dbe
1310 changed files with 141631 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
using UnityEngine;
// 영역 트리거. 이 콜라이더(isTrigger) 안으로 NPC(DialogPlayer 보유)가 들어오면
// 그 NPC의 현재 영역을 _regionKey로 전환한다.
// _regionKey는 해당 영역에서 재생할 DialogGroup의 이름과 일치해야 한다 (예: "Coast", "Hill").
//
// 주의: OnTriggerEnter가 동작하려면 들어오는 쪽(또는 트리거 쪽)에 Rigidbody가 있어야 하고,
// 이 오브젝트의 Collider는 Is Trigger여야 한다.
[RequireComponent(typeof(Collider))]
public class DialogRegion : MonoBehaviour
{
[SerializeField] private string _regionKey; // DialogGroup 이름과 일치
private void Reset()
{
// 컴포넌트 추가 시 편의상 트리거로 설정
var col = GetComponent<Collider>();
if (col != null) col.isTrigger = true;
}
private void OnTriggerEnter(Collider other)
{
var player = other.GetComponentInParent<DialogPlayer>();
if (player != null)
player.SetRegion(_regionKey);
}
}