63 lines
1.4 KiB
C#
63 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class TabUIData
|
|
{
|
|
/// <summary>
|
|
/// (자동설정) 탭 순서 0~
|
|
/// </summary>
|
|
public int m_Index;
|
|
|
|
public string btnBGImg_on, btnBGImg_off;
|
|
public string btnImg_on, btnImg_off;
|
|
public string btnNameImage_on, btnNameImage_off;
|
|
public int n_btnName = 0;
|
|
public string btnName;
|
|
|
|
public Color color_bg_on = Color.white;
|
|
public Color color_bg_off = Color.gray;
|
|
|
|
public Action onClick;
|
|
/// <summary>
|
|
/// (자동설정) 선택된 탭 설정, 탭 UI 상태 갱신
|
|
/// </summary>
|
|
public Action<int> onTabAction;
|
|
}
|
|
|
|
public class TabUIBase : uScrollViewMgr
|
|
{
|
|
int m_Index = 0;
|
|
|
|
public void Set(List<TabUIData> lst)
|
|
{
|
|
if (go_card.activeSelf) go_card.SetActive(false);
|
|
|
|
for (int i = 0; i < lst.Count; i++)
|
|
{
|
|
lst[i].m_Index = i;
|
|
lst[i].onTabAction = OnClick_Tab;
|
|
}
|
|
Set_ScrollView(lst);
|
|
Set_UI();
|
|
}
|
|
|
|
public override void Set_UI()
|
|
{
|
|
for (int i = 0; i < list_CardBase.Count; i++)
|
|
{
|
|
if (list_CardBase[i].Get_IntData() == m_Index)
|
|
list_CardBase[i].Set_CardType(eUICardType.UI);
|
|
else
|
|
list_CardBase[i].Set_CardType(eUICardType.NoTouch);
|
|
}
|
|
}
|
|
|
|
public int Get_Index() { return m_Index; }
|
|
|
|
void OnClick_Tab(int index)
|
|
{
|
|
m_Index = index;
|
|
Set_UI();
|
|
}
|
|
} |