2025-08-27 21:08:17 +00:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public class FirstBbugPopup : PopupBase
|
|
|
|
|
{
|
|
|
|
|
[SerializeField] private TMPro.TextMeshProUGUI tmp;
|
|
|
|
|
private long resultGold = 0;
|
|
|
|
|
public void SetData(bool isPlayer)
|
|
|
|
|
{
|
|
|
|
|
resultGold = GamePanel.Instance.Stake * 5;
|
2025-09-02 21:41:09 +00:00
|
|
|
var str_gold = CodeJay.CodeJayUtility.Converter.MoneyToString_withOutline(resultGold);
|
2025-08-27 21:08:17 +00:00
|
|
|
if (isPlayer)
|
|
|
|
|
{
|
2025-09-02 21:41:09 +00:00
|
|
|
tmp.text = $"첫 뻑이네요!\n{str_gold} 획득!";
|
2025-08-27 21:08:17 +00:00
|
|
|
GameManager.DB.AddGold(resultGold, this.name);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2025-09-02 21:41:09 +00:00
|
|
|
tmp.text = $"상대가 첫 뻑이네요!\n{str_gold} 뺏김!";
|
2025-08-27 21:08:17 +00:00
|
|
|
GameManager.DB.SubGold(resultGold, this.name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GamePanel.Instance.UpdateAIGold();
|
|
|
|
|
|
|
|
|
|
GameManager.Event.InvokeEvent(EEventType.OnSynchronizeGold);
|
|
|
|
|
GameManager.Sound.PlaySFX(ESFXType.Open_Popup);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void ConfirmButton()
|
|
|
|
|
{
|
|
|
|
|
GameManager.Sound.PlaySFX(ESFXType.Button_Hit);
|
|
|
|
|
GameManager.UI.HideTopPopup();
|
|
|
|
|
|
|
|
|
|
if (GamePanel.Instance.IsChallengeMode)
|
|
|
|
|
{
|
2025-08-29 13:01:17 +00:00
|
|
|
if (GameManager.DB.AddCurrentChallengeCondition(resultGold, true))
|
2025-08-27 21:08:17 +00:00
|
|
|
{
|
|
|
|
|
GameManager.UI.ShowNStackPopup<ResultPopup>(EPopupType.ResultPopup).WinWithFirstBbug(resultGold);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (GameManager.DB.AddNormalGameProgress(resultGold))
|
|
|
|
|
{
|
|
|
|
|
GameManager.UI.ShowNStackPopup<ResultPopup>(EPopupType.ResultPopup).WinWithFirstBbug(resultGold);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|