mouse event 처리 중

This commit is contained in:
logonkhi
2025-06-23 20:06:15 +09:00
parent f79372b4de
commit d8e753c1a1
68 changed files with 2676 additions and 272 deletions

View File

@@ -4,6 +4,7 @@ using UnityEngine.UI;
using UVC.Locale;
using UVC.Log;
using UVC.UI.Commands;
using UVC.UI.Modal;
namespace UVC.UI.Menu
{
@@ -226,7 +227,22 @@ namespace UVC.UI.Menu
}),
new MenuItemData("preferences", "menu_preferences", new DebugLogCommand("환경설정 선택됨 (Command 실행)"))
}));
model.MenuItems.Add(new MenuItemData("modal", "모달", subMenuItems: new List<MenuItemData>
{
new MenuItemData("alert", "Alert", new ActionCommand(async () => {
await Alert.Show("알림", "이것은 간단한 알림 메시지입니다.");
await Alert.Show("경고", "데이터를 저장할 수 없습니다.", "알겠습니다");
await Alert.Show("error", "error_network_not", "button_retry");
})),
new MenuItemData("confirm", "Confirm", new ActionCommand(async () => {
bool result = await Confirm.Show("확인", "이것은 간단한 알림 메시지입니다.");
ULog.Debug($"사용자가 확인 버튼을 눌렀나요? {result}");
result = await Confirm.Show("경고", "데이터를 저장할 수 없습니다.", "알겠습니다", "아니요");
ULog.Debug($"사용자가 알림을 확인했나요? {result}");
result = await Confirm.Show("error", "error_network_not", "button_retry", "button_cancel");
ULog.Debug($"사용자가 네트워크 오류 알림을 확인했나요? {result}");
}))
}));
model.MenuItems.Add(new MenuItemData("language", "menu_language", subMenuItems: new List<MenuItemData>
{
// 각 언어 메뉴 아이템에 ChangeLanguageCommand를 연결하여 언어 변경 기능 수행

View File

@@ -166,8 +166,7 @@ namespace UVC.UI.Menu
{
uiBlockerInstance = new GameObject("TopMenuUIBlocker");
// Canvas를 찾아 그 자식으로 설정합니다. 씬에 여러 Canvas가 있다면, 적절한 Canvas를 찾는 로직이 필요할 수 있습니다.
// 여기서는 FindFirstObjectByType을 사용하여 첫 번째 활성 Canvas를 찾습니다.
Canvas canvas = FindFirstObjectByType<Canvas>();
Canvas canvas = GetComponentInParent<Canvas>();
Transform blockerParent = canvas != null ? canvas.transform : transform.parent; // Canvas가 없으면 TopMenuView의 부모를 사용
if (blockerParent == null) // 부모를 찾지 못한 극단적인 경우, TopMenuView 자신을 부모로 설정 (권장되지 않음)