2025-04-15 02:47:07 +00:00
|
|
|
using TMPro;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public class GachaBase : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public TextMeshProUGUI[] texts; // 0 진행율, 1 등급장비1, 등급장비2
|
|
|
|
|
public MoneyForm[] moneyForms; // 0 10회1, 1 10회2, 2 1회
|
|
|
|
|
|
2025-04-15 05:08:56 +00:00
|
|
|
GachaConfigTableData m_Data;
|
|
|
|
|
|
2025-04-15 02:47:07 +00:00
|
|
|
public virtual void Set(int gacha)
|
|
|
|
|
{
|
|
|
|
|
gameObject.SetActive(true);
|
|
|
|
|
texts[1].text = DSUtil.Format(380, 0, MyText.Get_GradeName(4));
|
|
|
|
|
texts[2].text = DSUtil.Format(380, 0, MyText.Get_GradeName(5));
|
2025-04-15 05:08:56 +00:00
|
|
|
|
|
|
|
|
m_Data = table_gachaconfig.Ins.Get_Data_orNull(gacha);
|
|
|
|
|
moneyForms[0].Set(m_Data.n_GachaGoodsID, m_Data.n_GachaPrice * 10);
|
|
|
|
|
moneyForms[1].Set(table_GlobalValue.Ins.Get_Int("n_GachaTicketID"), 10);
|
|
|
|
|
moneyForms[2].Set(table_GlobalValue.Ins.Get_Int("n_GachaTicketID"), 1);
|
2025-04-15 02:47:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void OnClick_Gacha(int count)
|
|
|
|
|
{
|
2025-04-16 20:04:57 +00:00
|
|
|
var sdata = ServerInfo.Ins.m_ServerData;
|
|
|
|
|
var useTicket = sdata.Check_ItemAmount(table_GlobalValue.Ins.Get_Int("n_GachaTicketID"), count);
|
|
|
|
|
if (count == 1)
|
|
|
|
|
{ // 티켓만 사용
|
|
|
|
|
if (useTicket)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{ // 티켓 혹은 캐시템 사용
|
|
|
|
|
if (useTicket)
|
|
|
|
|
{ // 티켓 먼저 사용
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{ // 티켓 없으면 캐시템
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-04-15 02:47:07 +00:00
|
|
|
}
|
|
|
|
|
}
|