Files
XRLib/Assets/Scripts/SampleProject/UI/Menu/SampleProjectTopMenuView.cs
2025-06-11 19:24:08 +09:00

57 lines
2.7 KiB
C#

using UVC.UI.Menu;
using UnityEngine;
using UVC.Log; // 필요에 따라 UVC.Log 또는 프로젝트별 로깅 시스템 사용
namespace SampleProject.UI.Menu
{
public class SampleProjectTopMenuView : TopMenuView
{
// 프로젝트별 MenuItem 프리팹 경로 (덮어쓰기 예시)
// private new const string MenuItemPrefabPath = "Prefabs/SampleProject/UI/Menu/SampleMenuItem";
// 프로젝트별 MenuSeparator 프리팹 경로 (덮어쓰기 예시)
// private new const string MenuSeparatorPrefabPath = "Prefabs/SampleProject/UI/Menu/SampleMenuSeparator";
protected override void Awake()
{
base.Awake(); // 부모 클래스의 Awake 로직 실행
// 여기에 SampleProjectTopMenuView만의 초기화 로직 추가
// 예: 프로젝트별 프리팹 경로를 사용하도록 설정 변경
// if (!string.IsNullOrEmpty(MenuItemPrefabPath))
// {
// menuItemPrefab = Resources.Load<GameObject>(MenuItemPrefabPath);
// if (menuItemPrefab == null)
// {
// ULog.Error($"[SampleProject] 메뉴 아이템 프리팹을 Resources 폴더에서 로드할 수 없습니다. 경로: {MenuItemPrefabPath}");
// }
// }
//
// if (!string.IsNullOrEmpty(MenuSeparatorPrefabPath))
// {
// menuSeparatorPrefab = Resources.Load<GameObject>(MenuSeparatorPrefabPath);
// if (menuSeparatorPrefab == null)
// {
// ULog.Error($"[SampleProject] 메뉴 구분선 프리팹을 Resources 폴더에서 로드할 수 없습니다. 경로: {MenuSeparatorPrefabPath}");
// }
// }
// 예: 프로젝트별 메뉴 아이템 크기 및 간격 변경
// menuItemWidth = 120;
// menuItemHeight = 35;
// menuItemHorizontalGap = 5;
ULog.Debug("SampleProjectTopMenuView Awake 실행됨");
}
// 필요하다면 CreateMenuItems, LayoutMenuItem 등의 메서드를 override하여
// 프로젝트에 특화된 메뉴 생성 및 레이아웃 로직을 구현할 수 있습니다.
// 예시:
// public override Vector2 CreateMenuItems(List<MenuItemData> items, Transform parentContainer, int depth = 0)
// {
// ULog.Debug("SampleProjectTopMenuView CreateMenuItems 실행됨");
// // 프로젝트별 추가 로직...
// return base.CreateMenuItems(items, parentContainer, depth);
// }
// 프로젝트별로 특정 UI 요소의 동작을 변경하거나 추가할 수 있습니다.
}
}