nightward/Assets/Scripts/UI/AlbumUI.cs

61 lines
1.8 KiB
C#

using TMPro;
using UnityEngine;
public class AlbumUI : uScrollViewMgr
{
public TextMeshProUGUI[] texts; // 0 이름, 1 카운팅, 2 보유 하트
public GameObject[] gos_onoff;
public AlbumCard[] specialCards;
int curGirl = 1;
private void OnEnable()
{
DSUtil.InActivateGameObjects(gos_onoff);
}
private void OnDisable()
{
DSUtil.ActivateGameObjects(gos_onoff);
}
public void Set(int girlid = 0)
{
gameObject.SetActive(true);
SoundInfo.Ins.Play_BGM(eBGM.b006_Album);
DSUtil.InActivateGameObjects(gos_onoff);
if (girlid > 0) curGirl = girlid;
Set_ScrollView(table_album.Ins.Get_AlbumDataList(curGirl));
texts[0].text = table_girl.Ins.Get_Data(curGirl).s_Name;
Set_UI();
}
public void Set_UI()
{
var count = 0;
for (int i = 0; i < list_CardBase.Count; i++)
{
if ((list_CardBase[i] as AlbumCard).IsObtain())
++count;
}
texts[1].text = $"{count}/{table_album.Ins.Get_DataList(curGirl).Count}";
texts[2].text = SaveMgr.Ins.Get_Money(eMoney.AlbumOpen).ToString();
list_CardBase.ForEach(f => f.Set_UI());
specialCards[0].Set(table_album.Ins.Get_SpecialAlbum(curGirl, eCollectionMethod.Default));
specialCards[1].Set(table_album.Ins.Get_SpecialAlbum(curGirl, eCollectionMethod.Gacha));
specialCards[2].Set(table_album.Ins.Get_SpecialAlbum(curGirl, eCollectionMethod.FullCollection));
specialCards[3].Set(table_album.Ins.Get_SpecialAlbum(curGirl, eCollectionMethod.Mission));
}
public void OnClick_Arrow(int add)
{
curGirl += add;
if (curGirl > 8) curGirl = 1;
else if (curGirl < 1) curGirl = 8;
Set();
}
}