84 lines
2.7 KiB
C#
84 lines
2.7 KiB
C#
using TMPro;
|
|
using UnityEngine;
|
|
|
|
public class ChangeGirlUI : uScrollViewMgr
|
|
{
|
|
public TextMeshProUGUI t_name, t_heartPrice;
|
|
public GameObject[] gos_btn; // 0 확인, 1 미개방, 2 변경(광고), 3 변경(하트)
|
|
|
|
public void Set()
|
|
{
|
|
gameObject.SetActive(true);
|
|
t_name.text = table_girl.Ins.Get_Data(SaveMgr.Ins.Get_SelectGirlID()).s_Name;
|
|
t_heartPrice.text = table_GlobalValue.Ins.Get_Int("SelectGirlHeartPrice").ToString();
|
|
Set_ScrollView(table_girl.Ins.Get_DataList());
|
|
|
|
for (int i = 0; i < list_CardBase.Count; i++)
|
|
{
|
|
if (list_CardBase[i].Get_IntData() == SaveMgr.Ins.Get_SelectGirlID())
|
|
{
|
|
SelectCard(list_CardBase[i] as ChangeGirlCard);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
public void SelectCard(ChangeGirlCard card)
|
|
{
|
|
if (m_SelectCard != null)
|
|
m_SelectCard.Set_Selected(false);
|
|
|
|
m_SelectCard = card;
|
|
if (m_SelectCard != null)
|
|
{
|
|
m_SelectCard.Set_Selected(true);
|
|
if (SaveMgr.Ins.IsObtainGirl(m_SelectCard.Get_IntData()))
|
|
{ // 보유 중
|
|
if (m_SelectCard.Get_IntData() == SaveMgr.Ins.Get_SelectGirlID())
|
|
{ // 선택 중
|
|
DSUtil.InActivateGameObjects(gos_btn, 0);
|
|
}
|
|
else
|
|
{
|
|
DSUtil.InActivateGameObjects(gos_btn, 2);
|
|
gos_btn[3].SetActive(true);
|
|
}
|
|
}
|
|
else
|
|
{ // 미보유
|
|
DSUtil.InActivateGameObjects(gos_btn, 1);
|
|
}
|
|
}
|
|
}
|
|
|
|
public void OnClick_Btn(GameObject obj)
|
|
{
|
|
switch (obj.name)
|
|
{
|
|
case "btn_ad_change":
|
|
ADInfo.Ins.Show_AD(false, () =>
|
|
{
|
|
SaveMgr.Ins.Set_SelectGirlID(m_SelectCard.Get_IntData());
|
|
|
|
Set_ScrollView(table_girl.Ins.Get_DataList());
|
|
LobbyUI.Ins.m_LobbyCenterProfileUI.Set();
|
|
Set();
|
|
});
|
|
break;
|
|
case "btn_buy_change":
|
|
if (SaveMgr.Ins.Check_Money(eMoney.AlbumOpen, table_GlobalValue.Ins.Get_Int("SelectGirlHeartPrice")))
|
|
{
|
|
SaveMgr.Ins.Add_Money(eMoney.AlbumOpen, -table_GlobalValue.Ins.Get_Int("SelectGirlHeartPrice"));
|
|
SaveMgr.Ins.Set_SelectGirlID(m_SelectCard.Get_IntData());
|
|
|
|
Set_ScrollView(table_girl.Ins.Get_DataList());
|
|
LobbyUI.Ins.m_LobbyCenterProfileUI.Set();
|
|
Set();
|
|
}
|
|
break;
|
|
default:
|
|
gameObject.SetActive(false);
|
|
break;
|
|
}
|
|
}
|
|
} |