Files
XRLib/Assets/Scripts/Studio/StudioSideTabBar.cs
2025-12-15 20:17:38 +09:00

52 lines
1.4 KiB
C#

#nullable enable
using UVC.Studio.Cameras;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.EventSystems;
using UVC.Core;
using UVC.UI.List.ComponentList;
using UVC.UI.Tab;
namespace UVC.Studio
{
public class StudioSideTabBar : MonoBehaviour
{
[SerializeField]
private TabController? tabController;
private void Awake()
{
if (tabController == null)
{
Debug.LogError("SideTabBar: TabController가 할당되지 않았습니다.");
return;
}
}
public void InitTab()
{
var infos = ComponentList.GenerateData();
// 1. TabConfig 설정
tabController?.AddTabConfig("Explorer", "탐색기", "Factory/Prefabs/Tab/TabContentComponentListTab", "Prefabs/UI/Images/icon_side_tab_explorer_24", infos, true);
tabController?.AddTabConfig("Library", "라이브러리", "Factory/Prefabs/Tab/TabContentLibraryGrid", "Prefabs/UI/Images/icon_side_tab_library_24", "라이브러리", true);
// 2. 컨트롤러 초기화
tabController?.Initialize();
if (tabController != null)
{
tabController.OnTabChanged += (index) =>
{
Debug.Log($"탭이 변경되었습니다: {index}");
};
}
}
}
}