2025-09-03 20:40:30 +00:00
|
|
|
using TMPro;
|
2025-09-03 21:42:31 +00:00
|
|
|
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)
|
|
|
|
|
{
|
2025-09-03 21:42:31 +00:00
|
|
|
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
|
|
|
|
2025-09-10 23:33:13 +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 21:42:31 +00:00
|
|
|
}
|
2025-09-03 05:46:23 +00:00
|
|
|
}
|
|
|
|
|
|
2025-09-10 22:41:03 +00:00
|
|
|
int Get_Price() { return 100; }
|
|
|
|
|
|
2025-09-03 05:46:23 +00:00
|
|
|
public void ClickYes()
|
|
|
|
|
{
|
2025-09-10 22:41:03 +00:00
|
|
|
if (!GamePanel.Instance.IsPreview && GameManager.DB.Key >= Get_Price())
|
2025-09-03 20:40:30 +00:00
|
|
|
{
|
2025-09-10 22:41:03 +00:00
|
|
|
GameManager.DB.SubKey(Get_Price(), name);
|
2025-09-03 21:42:31 +00:00
|
|
|
GameManager.DB.SaveDatas();
|
|
|
|
|
GamePanel.Instance.IsPreview = true;
|
2025-09-03 20:40:30 +00:00
|
|
|
GameManager.UI.HideTopPopup();
|
|
|
|
|
GameManager.UI.ShowNStackPopup(EPopupType.PreViewUIPopup);
|
|
|
|
|
}
|
2025-09-10 22:41:03 +00:00
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
}
|