RandomGFGoStop/Assets/Scripts/UI/Popup/PreviewPopup.cs

42 lines
1.0 KiB
C#
Raw Normal View History

2025-09-03 20:40:30 +00:00
using TMPro;
2025-09-03 05:46:23 +00:00
public class PreviewPopup : PopupBase
{
2025-09-03 20:40:30 +00:00
public TextMeshProUGUI t_price;
int m_price = 100;
2025-09-03 05:46:23 +00:00
public override void ShowPopup(int drawOrder)
{
base.ShowPopup(drawOrder);
GameManager.Sound.PlaySFX(ESFXType.Open_Popup);
2025-09-03 20:40:30 +00:00
t_price.text = m_price.ToString();
2025-09-03 05:46:23 +00:00
}
public void ClickYes()
{
2025-09-03 20:40:30 +00:00
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);
}
}
2025-09-03 05:46:23 +00:00
}
public void ClickCancel()
{
GameManager.Sound.PlaySFX(ESFXType.Button_Hit);
GameManager.UI.HideTopPopup();
}
}