42 lines
1.0 KiB
C#
42 lines
1.0 KiB
C#
using TMPro;
|
|
|
|
public class PreviewPopup : PopupBase
|
|
{
|
|
public TextMeshProUGUI t_price;
|
|
|
|
int m_price = 100;
|
|
|
|
public override void ShowPopup(int drawOrder)
|
|
{
|
|
base.ShowPopup(drawOrder);
|
|
GameManager.Sound.PlaySFX(ESFXType.Open_Popup);
|
|
|
|
t_price.text = m_price.ToString();
|
|
}
|
|
|
|
public void ClickYes()
|
|
{
|
|
if (GamePanel.Instance.IsPreview)
|
|
{
|
|
GameManager.UI.HideTopPopup();
|
|
GameManager.UI.ShowNStackPopup(EPopupType.PreViewUIPopup);
|
|
}
|
|
else
|
|
{
|
|
if (GameManager.DB.Gold >= m_price)
|
|
{
|
|
GameManager.DB.SubGold(m_price, name);
|
|
GameManager.DB.SaveDatas();
|
|
GamePanel.Instance.IsPreview = true;
|
|
GameManager.UI.HideTopPopup();
|
|
GameManager.UI.ShowNStackPopup(EPopupType.PreViewUIPopup);
|
|
}
|
|
}
|
|
}
|
|
|
|
public void ClickCancel()
|
|
{
|
|
GameManager.Sound.PlaySFX(ESFXType.Button_Hit);
|
|
GameManager.UI.HideTopPopup();
|
|
}
|
|
} |