2026-04-27 대화 선택지 시스템
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu(menuName = "Communication/Dialog Node")]
|
||||
@@ -25,4 +25,7 @@ public class DialogNode : ScriptableObject
|
||||
[Header("Flow")]
|
||||
public DialogNode Next; // 선택지 없을 때 자동으로 갈 노드
|
||||
public List<DialogChoice> Choices; // 있으면 플레이어 선택 대기
|
||||
|
||||
[Header("ChoiceQuestion")]
|
||||
[TextArea(2,5)] public string ChoiceQuestion;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine;
|
||||
using VRShopping.UI;
|
||||
|
||||
[RequireComponent(typeof(CharacterVoiceObject))]
|
||||
public class DialogPlayer : MonoBehaviour
|
||||
@@ -174,10 +175,12 @@ private async Awaitable PlayNode(DialogNode node)
|
||||
|
||||
private async Awaitable<int> WaitForChoice(DialogNode node)
|
||||
{
|
||||
// TODO: 선택지 UI 띄우기. 일단은 첫 번째 선택지 자동 선택 (테스트용)
|
||||
Debug.Log("[DialogPlayer] 선택지 대기 — 일단 0번 자동 선택");
|
||||
await Awaitable.WaitForSecondsAsync(0.5f);
|
||||
return 0;
|
||||
if (ChoiceHud.Instance == null)
|
||||
{
|
||||
Debug.LogWarning("[DialogPlayer] ChoiceHud 없음 — 0번 자동 선택");
|
||||
return 0;
|
||||
}
|
||||
return await ChoiceHud.Instance.Show(node.Speaker, node.ChoiceQuestion ,node.Choices);
|
||||
}
|
||||
|
||||
private async Awaitable WaitForAdvanceInput()
|
||||
|
||||
Reference in New Issue
Block a user