From 887968fcfd58ee2434d5ff36ccd767dc7358f8ee Mon Sep 17 00:00:00 2001 From: "NJ\\skrwn" Date: Sun, 26 Jul 2026 19:25:03 +0900 Subject: [PATCH] =?UTF-8?q?UI=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/01_Scenes/TestScene.unity | 4 +- Assets/02_Scripts/_Debug.meta | 8 +++ Assets/02_Scripts/_Debug/DialogUITester.cs | 51 +++++++++++++++++++ .../02_Scripts/_Debug/DialogUITester.cs.meta | 2 + .../_UI/Communication/DialogEnterHud.cs | 1 - Assets/08_UI/DialogEnterPanelSettings.asset | 2 +- Assets/08_UI/DialogEnterRow.uxml | 6 +-- Assets/08_UI/DialogEnterUI.uxml | 2 +- 8 files changed, 68 insertions(+), 8 deletions(-) create mode 100644 Assets/02_Scripts/_Debug.meta create mode 100644 Assets/02_Scripts/_Debug/DialogUITester.cs create mode 100644 Assets/02_Scripts/_Debug/DialogUITester.cs.meta diff --git a/Assets/01_Scenes/TestScene.unity b/Assets/01_Scenes/TestScene.unity index 67a7604..a9324ac 100644 --- a/Assets/01_Scenes/TestScene.unity +++ b/Assets/01_Scenes/TestScene.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f4edbc8daf52ee01600ad166b48fda5206798482438aac254024d86d9b5918c5 -size 19782 +oid sha256:77bf19d97db8f543f37c057eadf59caacde7b253fd9c5d67a447d63e8d3cda04 +size 21069 diff --git a/Assets/02_Scripts/_Debug.meta b/Assets/02_Scripts/_Debug.meta new file mode 100644 index 0000000..2573a53 --- /dev/null +++ b/Assets/02_Scripts/_Debug.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1d446a26b15675f42a35cbd918bb81f8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/02_Scripts/_Debug/DialogUITester.cs b/Assets/02_Scripts/_Debug/DialogUITester.cs new file mode 100644 index 0000000..e6ce10d --- /dev/null +++ b/Assets/02_Scripts/_Debug/DialogUITester.cs @@ -0,0 +1,51 @@ +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.InputSystem; + +// 임시 테스트용 — 실제 대화 시스템(NPC/StoryDatabase) 없이 UI만 확인한다. +// 씬의 아무 빈 오브젝트에 붙이고 Play: +// Space → 대사 HUD(DialogHud)에 다음 대사 표시 +// Tab → 대화 선택 메뉴(DialogEnterHud) 띄우기 (행 클릭 시 결과 표시) +// 확인이 끝나면 이 스크립트/오브젝트는 삭제해도 된다. +public class DialogUITester : MonoBehaviour +{ + private readonly string[] _lines = + { + "안녕, 이건 테스트 대사야.", + "UI가 화면 하단에 잘 보이면 성공이다.", + "다음 줄로 넘어가려면 스페이스를 눌러.", + }; + private int _index; + + private void Update() + { + var kb = Keyboard.current; + if (kb == null) return; + + // Space → 대사 HUD 표시 + if (kb.spaceKey.wasPressedThisFrame && DialogHud.Instance != null) + { + DialogHud.Instance.Show(null, _lines[_index % _lines.Length], "테스트"); + _index++; + } + + // Tab → 대화 선택 메뉴 표시 + if (kb.tabKey.wasPressedThisFrame && DialogEnterHud.Instance != null) + _ = ShowMenu(); + } + + private async Awaitable ShowMenu() + { + var options = new List + { + new() { ChoiceText = "첫 번째 대화" }, + new() { ChoiceText = "두 번째 대화" }, + new() { ChoiceText = "세 번째 대화" }, + }; + + int picked = await DialogEnterHud.Instance.Show(options); + Debug.Log($"[DialogUITester] 선택됨: {picked}"); + if (DialogHud.Instance != null) + DialogHud.Instance.Show(null, $"{picked + 1}번째 대화를 골랐구나.", "테스트"); + } +} diff --git a/Assets/02_Scripts/_Debug/DialogUITester.cs.meta b/Assets/02_Scripts/_Debug/DialogUITester.cs.meta new file mode 100644 index 0000000..ea3f5f5 --- /dev/null +++ b/Assets/02_Scripts/_Debug/DialogUITester.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 343d04c3929d77e4fbc36510d86b8736 \ No newline at end of file diff --git a/Assets/02_Scripts/_UI/Communication/DialogEnterHud.cs b/Assets/02_Scripts/_UI/Communication/DialogEnterHud.cs index 62ca1bb..f3c4b8c 100644 --- a/Assets/02_Scripts/_UI/Communication/DialogEnterHud.cs +++ b/Assets/02_Scripts/_UI/Communication/DialogEnterHud.cs @@ -52,7 +52,6 @@ private bool EnsureRefs() if (_listView != null) { _listView.selectionType = SelectionType.Single; - _listView.fixedItemHeight = 40; // 행 높이 (필요하면 인스펙터의 Fixed Item Height로 조정) _listView.bindItem = BindRow; // item-template(DialogEnterRow)이 makeItem을 담당, 바인딩만 우리가 _listView.selectionChanged += OnSelectionChanged; } diff --git a/Assets/08_UI/DialogEnterPanelSettings.asset b/Assets/08_UI/DialogEnterPanelSettings.asset index 4eb9d86..98adef1 100644 --- a/Assets/08_UI/DialogEnterPanelSettings.asset +++ b/Assets/08_UI/DialogEnterPanelSettings.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cbabf76cf5e2ee40a9308eb3b2d9da68a7d6716a9e497007d54f687d2573add3 +oid sha256:2048c30d337e09b5eabd8998924f1acb0b6f137dc40445e506159b88f39c529b size 1958 diff --git a/Assets/08_UI/DialogEnterRow.uxml b/Assets/08_UI/DialogEnterRow.uxml index bfc9e31..5d0c250 100644 --- a/Assets/08_UI/DialogEnterRow.uxml +++ b/Assets/08_UI/DialogEnterRow.uxml @@ -1,7 +1,7 @@ - - - + + + diff --git a/Assets/08_UI/DialogEnterUI.uxml b/Assets/08_UI/DialogEnterUI.uxml index 969d489..d1288a8 100644 --- a/Assets/08_UI/DialogEnterUI.uxml +++ b/Assets/08_UI/DialogEnterUI.uxml @@ -2,7 +2,7 @@ - +