From 1e484ff5427044954265aff960fe600420802abb Mon Sep 17 00:00:00 2001 From: Ino Date: Thu, 4 Sep 2025 05:40:30 +0900 Subject: [PATCH] =?UTF-8?q?=EC=97=BF=EB=B3=B4=EA=B8=B0=20=EC=9E=91?= =?UTF-8?q?=EC=97=85=20=EC=A4=91...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Prefabs/Popups/PreviewPopup.prefab | 3 ++- Assets/Scripts/UI/GamePanel/GamePanel.cs | 3 ++- Assets/Scripts/UI/Popup/PreviewPopup.cs | 25 ++++++++++++++++++- Assets/Scripts/UI/Popup/PreviewUIPopup.cs | 13 +++++----- 4 files changed, 35 insertions(+), 9 deletions(-) diff --git a/Assets/Resources/Prefabs/Popups/PreviewPopup.prefab b/Assets/Resources/Prefabs/Popups/PreviewPopup.prefab index 070adee..608fc9b 100644 --- a/Assets/Resources/Prefabs/Popups/PreviewPopup.prefab +++ b/Assets/Resources/Prefabs/Popups/PreviewPopup.prefab @@ -1087,6 +1087,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 104d2f59a70ee674082784f42bca5fa7, type: 3} m_Name: m_EditorClassIdentifier: + t_price: {fileID: 6102819711600179842} --- !u!1 &4215562155681747119 GameObject: m_ObjectHideFlags: 0 @@ -1251,7 +1252,7 @@ GameObject: - component: {fileID: 4948831804711677941} - component: {fileID: 6102819711600179842} m_Layer: 5 - m_Name: New TMP + m_Name: t_price m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 diff --git a/Assets/Scripts/UI/GamePanel/GamePanel.cs b/Assets/Scripts/UI/GamePanel/GamePanel.cs index 5dd1c67..32ab5a4 100644 --- a/Assets/Scripts/UI/GamePanel/GamePanel.cs +++ b/Assets/Scripts/UI/GamePanel/GamePanel.cs @@ -44,6 +44,7 @@ public partial class GamePanel : MonoBehaviour public bool PlayerTurn { get; set; } = true; public bool GameOver { get; set; } = true; public int Stake { get; set; } = 100; + public bool IsPreview { get; set; } = false; #region MonoBehaviour private void Awake() @@ -350,7 +351,7 @@ public partial class GamePanel : MonoBehaviour private void Initialize() { GameManager.Sound.PlayBGM(EBGMType.BGM_2); - UseSepYulgget_To_Pee = false; + IsPreview = UseSepYulgget_To_Pee = false; this.GamePanelEnabled(true); go_toppanel.SetActive(false); i_ai.sprite = DB_HuntingData.GetEntity(GameManager.DB.GetUnlockTargetIndex(true) << 1).DBF_UnlockImage; diff --git a/Assets/Scripts/UI/Popup/PreviewPopup.cs b/Assets/Scripts/UI/Popup/PreviewPopup.cs index 452b620..277b6e4 100644 --- a/Assets/Scripts/UI/Popup/PreviewPopup.cs +++ b/Assets/Scripts/UI/Popup/PreviewPopup.cs @@ -1,14 +1,37 @@ +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() { - GameManager.UI.HideTopPopup(); + 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() diff --git a/Assets/Scripts/UI/Popup/PreviewUIPopup.cs b/Assets/Scripts/UI/Popup/PreviewUIPopup.cs index 011e6b0..f906c8d 100644 --- a/Assets/Scripts/UI/Popup/PreviewUIPopup.cs +++ b/Assets/Scripts/UI/Popup/PreviewUIPopup.cs @@ -1,21 +1,22 @@ -using UnityEngine; +using TMPro; public class PreviewUIPopup : PopupBase { + public TextMeshProUGUI[] texts; // 0 소지금, 1 레벨, 2 0점 X 0배, 3 고, 4 흔듦, 5 뻑 + public TextMeshProUGUI[] texts_mission; // 0 메인 미션, 1 서브 미션 + public TextMeshProUGUI[] texts_cardcount; // 0 광, 1 열끗, 2 띠, 3 피 + public override void ShowPopup(int drawOrder) { base.ShowPopup(drawOrder); GameManager.Sound.PlaySFX(ESFXType.Open_Popup); - } - - public void ClickYes() - { - GameManager.UI.HideTopPopup(); + GameManager.ADS.HideBanner(); } public void ClickCancel() { GameManager.Sound.PlaySFX(ESFXType.Button_Hit); GameManager.UI.HideTopPopup(); + GameManager.ADS.ShowBanner(); } } \ No newline at end of file