70 lines
1.7 KiB
C#
70 lines
1.7 KiB
C#
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class MiniGameAlbumSelect : uScrollViewMgr
|
|
{
|
|
public Image[] images_btn;
|
|
public Image image_gogame;
|
|
|
|
List<Color32> list_btnColor = new List<Color32>
|
|
{
|
|
new Color32(146,164,180,255), // šĚźąĹĂ
|
|
new Color32(0,163,206,255) // źąĹĂ
|
|
};
|
|
|
|
int CurTab = 0;
|
|
|
|
public void Set()
|
|
{
|
|
gameObject.SetActive(true);
|
|
Set_UI();
|
|
}
|
|
|
|
void Set_UI()
|
|
{
|
|
images_btn[0].color = list_btnColor[CurTab == 0 ? 1 : 0];
|
|
images_btn[1].color = list_btnColor[CurTab == 1 ? 1 : 0];
|
|
|
|
var lst = table_album.Ins.Get_DataList(CurTab == 0 ? eCollectionMethod.Default : eCollectionMethod.FullCollection);
|
|
Set_ScrollView(lst, SaveMgr.Ins.Get_SelectGirlID());
|
|
}
|
|
|
|
public void Select_Card(MiniGameAlbumSelectCard card)
|
|
{
|
|
if (m_SelectCard) m_SelectCard.Set_Selected(false);
|
|
m_SelectCard = card;
|
|
if (m_SelectCard)
|
|
{
|
|
m_SelectCard.Set_Selected(true);
|
|
image_gogame.sprite = UIAtlasMgr.Ins.Get_Sprite("red_btn");
|
|
}
|
|
else
|
|
{
|
|
image_gogame.sprite = UIAtlasMgr.Ins.Get_Sprite("btn_gray");
|
|
}
|
|
}
|
|
|
|
public int Get_CurTab() { return CurTab; }
|
|
|
|
public void OnClick_Btn(int index)
|
|
{
|
|
CurTab = index;
|
|
Set_UI();
|
|
}
|
|
|
|
public void OnClick_GoMiniGame()
|
|
{
|
|
if (m_SelectCard)
|
|
{
|
|
if (SaveMgr.Ins.IsInfinityMiniGame())
|
|
{
|
|
}
|
|
else if (SaveMgr.Ins.Check_Money(eMoney.MiniGameHP, 1, true))
|
|
{
|
|
SaveMgr.Ins.Add_Money(eMoney.MiniGameHP, -1);
|
|
SaveMgr.Ins.Save();
|
|
}
|
|
}
|
|
}
|
|
} |