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

49 lines
1.3 KiB
C#
Raw Normal View History

2025-09-03 20:40:30 +00:00
using TMPro;
using UnityEngine;
2025-09-03 20:40:30 +00:00
2025-09-03 05:46:23 +00:00
public class PreviewPopup : PopupBase
{
2025-09-03 20:40:30 +00:00
public TextMeshProUGUI t_price;
2025-09-03 05:46:23 +00:00
public override void ShowPopup(int drawOrder)
{
if (GamePanel.Instance.IsPreview)
{
GameManager.UI.HideTopPopup();
GameManager.UI.ShowNStackPopup(EPopupType.PreViewUIPopup);
}
else
{
base.ShowPopup(drawOrder);
GameManager.Sound.PlaySFX(ESFXType.Open_Popup);
2025-09-03 20:40:30 +00:00
//t_price.text = $"{Get_Price()} / {GameManager.DB.Key}";
//t_price.color = Get_Price() > GameManager.DB.Key ? Color.red : Color.green;
}
2025-09-03 05:46:23 +00:00
}
int Get_Price() { return 100; }
2025-09-03 05:46:23 +00:00
public void ClickYes()
{
if (!GamePanel.Instance.IsPreview && GameManager.DB.Key >= Get_Price())
2025-09-03 20:40:30 +00:00
{
GameManager.DB.SubKey(Get_Price(), name);
GameManager.DB.SaveDatas();
GamePanel.Instance.IsPreview = true;
2025-09-03 20:40:30 +00:00
GameManager.UI.HideTopPopup();
GameManager.UI.ShowNStackPopup(EPopupType.PreViewUIPopup);
}
else
{
ClickCancel();
GameManager.UI.ShowNStackPopup(EPopupType.NoDiaPPopup);
}
2025-09-03 05:46:23 +00:00
}
public void ClickCancel()
{
GameManager.Sound.PlaySFX(ESFXType.Button_Hit);
GameManager.UI.HideTopPopup();
}
}