2026-06-19 UI, UI로직

This commit is contained in:
skrwns304@gmail.com
2026-06-19 14:27:40 +09:00
parent b751a9ed66
commit b1e85a5b89
549 changed files with 18058 additions and 20 deletions

View File

@@ -0,0 +1,47 @@
using UnityEngine;
[DisallowMultipleComponent]
public class NPCInteract : MonoBehaviour
{
[Header("Dialogue Data")]
[SerializeField] private DialogueData dialogue;
[Header("Reference")]
[SerializeField] private DialogueManager manager;
[Header("Settings")]
[SerializeField] private bool autoFindManager = true;
private void Awake()
{
if (manager == null && autoFindManager)
manager = FindFirstObjectByType<DialogueManager>();
}
public void Interact()
{
if (dialogue == null)
{
Debug.LogWarning($"[NPCInteract] {name}에 DialogueData가 연결되지 않았습니다.");
return;
}
if (manager == null)
{
Debug.LogWarning($"[NPCInteract] {name}에 DialogueManager가 연결되지 않았습니다.");
return;
}
manager.StartDialogueFromNPC(dialogue, transform);
}
public void SetDialogue(DialogueData newDialogue)
{
dialogue = newDialogue;
}
public void SetManager(DialogueManager newManager)
{
manager = newManager;
}
}