40 lines
1.3 KiB
C#
40 lines
1.3 KiB
C#
using UnityEngine;
|
|
using UVC.UI.List.ComponentList;
|
|
using UVC.UI.Tab;
|
|
|
|
public class SideBarSample : MonoBehaviour
|
|
{
|
|
|
|
[SerializeField]
|
|
private TabController tabController;
|
|
|
|
void Start()
|
|
{
|
|
setupSideBar();
|
|
}
|
|
|
|
|
|
void setupSideBar()
|
|
{
|
|
|
|
var infos = ComponentList.GenerateData();
|
|
|
|
// 1. TabConfig 설정
|
|
tabController?.AddTabConfig("Explorer", "탐색기", "Factory/Prefabs/Tab/TabContentComponentListTab", "Prefabs/UI/Images/icon_side_tab_explorer_128", infos, true);
|
|
tabController?.AddTabConfig("Library", "라이브러리", "Factory/Prefabs/Tab/TabContentLibraryGrid", "Prefabs/UI/Images/icon_side_tab_library_128", "라이브러리", true);
|
|
tabController?.AddTabConfig("ResourceExplorer", "Hierarchy", "Factory/Prefabs/Tab/TabContentHierarchy", "Prefabs/UI/Images/icon_side_tab_resource_128", "Hierarchy", true);
|
|
tabController?.AddTabConfig("FleetManager", "이동기 관리", "Prefabs/UI/Tab/TabContentSample", "Prefabs/UI/Images/icon_side_tab_fleet_128", "이동기 관리", true);
|
|
|
|
// 2. 컨트롤러 초기화
|
|
tabController?.Initialize();
|
|
|
|
if (tabController != null)
|
|
{
|
|
tabController.OnTabChanged += (index) =>
|
|
{
|
|
Debug.Log($"탭이 변경되었습니다: {index}");
|
|
};
|
|
}
|
|
}
|
|
}
|