From 8593b92380435823f239eb1635bb4b1df834aa13 Mon Sep 17 00:00:00 2001 From: Mingu Kim Date: Thu, 6 Mar 2025 16:18:55 +0900 Subject: [PATCH] =?UTF-8?q?=EC=83=81=EC=A0=90=20=ED=8F=AC=EC=85=98=20?= =?UTF-8?q?=EA=B5=AC=EB=A7=A4=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Resources/UI/Prefabs/UI.ShopUI.prefab | 352 ++++-------------- .../Assets/Gameton/Scripts/UI/ShopUI.cs | 72 +++- 2 files changed, 121 insertions(+), 303 deletions(-) diff --git a/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/UI.ShopUI.prefab b/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/UI.ShopUI.prefab index c93fdcdd..fbac5351 100644 --- a/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/UI.ShopUI.prefab +++ b/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/UI.ShopUI.prefab @@ -574,9 +574,8 @@ GameObject: - component: {fileID: 2892038168161912038} - component: {fileID: 7630059591734118752} - component: {fileID: 6983656107323574389} - - component: {fileID: 8378295245954313219} m_Layer: 5 - m_Name: ItemButton (1) + m_Name: HPPosion5 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -640,50 +639,6 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 ---- !u!114 &8378295245954313219 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 691656603659687742} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_SelectedTrigger: Selected - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 6983656107323574389} - m_OnClick: - m_PersistentCalls: - m_Calls: [] --- !u!1 &710390463410262043 GameObject: m_ObjectHideFlags: 0 @@ -1092,9 +1047,8 @@ GameObject: - component: {fileID: 5878055121648309242} - component: {fileID: 8900813354726715018} - component: {fileID: 2669733002445248477} - - component: {fileID: 2052433123704436150} m_Layer: 5 - m_Name: ItemButton (3) + m_Name: MPPosion1 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -1158,50 +1112,6 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 ---- !u!114 &2052433123704436150 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1009847202782383007} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_SelectedTrigger: Selected - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 2669733002445248477} - m_OnClick: - m_PersistentCalls: - m_Calls: [] --- !u!1 &1013687654832446300 GameObject: m_ObjectHideFlags: 0 @@ -1694,9 +1604,8 @@ GameObject: - component: {fileID: 4377812817425128428} - component: {fileID: 482926518250686575} - component: {fileID: 2372124851589078198} - - component: {fileID: 2226929151058945600} m_Layer: 5 - m_Name: ItemButton + m_Name: HPPosion1 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -1760,50 +1669,6 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 ---- !u!114 &2226929151058945600 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1238659231047176221} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_SelectedTrigger: Selected - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 2372124851589078198} - m_OnClick: - m_PersistentCalls: - m_Calls: [] --- !u!1 &1532305578790772048 GameObject: m_ObjectHideFlags: 0 @@ -2904,7 +2769,19 @@ MonoBehaviour: m_TargetGraphic: {fileID: 549035171605257164} m_OnClick: m_PersistentCalls: - m_Calls: [] + m_Calls: + - m_Target: {fileID: 6017598305918751662} + m_TargetAssemblyTypeName: TON.ShopUI, Assembly-CSharp + m_MethodName: OnClickBuyMpPotion5Button + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 --- !u!1 &2802790137596343876 GameObject: m_ObjectHideFlags: 0 @@ -3065,7 +2942,7 @@ MonoBehaviour: m_Calls: - m_Target: {fileID: 6017598305918751662} m_TargetAssemblyTypeName: TON.ShopUI, Assembly-CSharp - m_MethodName: OnClickBuyMpPotionButton + m_MethodName: OnClickBuyMpPotion1Button m_Mode: 1 m_Arguments: m_ObjectArgument: {fileID: 0} @@ -3429,9 +3306,8 @@ GameObject: - component: {fileID: 575786137439827299} - component: {fileID: 7213725879036316037} - component: {fileID: 7261399155026450201} - - component: {fileID: 1251393139371550817} m_Layer: 5 - m_Name: ItemButton (4) + m_Name: MPPosion5 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -3495,50 +3371,6 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 ---- !u!114 &1251393139371550817 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3505227747080097614} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_SelectedTrigger: Selected - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 7261399155026450201} - m_OnClick: - m_PersistentCalls: - m_Calls: [] --- !u!1 &3537501273437892278 GameObject: m_ObjectHideFlags: 0 @@ -3625,9 +3457,8 @@ GameObject: - component: {fileID: 5207883494733701616} - component: {fileID: 3548960397052590429} - component: {fileID: 8426959644519684905} - - component: {fileID: 2797302821141521614} m_Layer: 5 - m_Name: ItemButton (2) + m_Name: HPPosion20 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -3691,50 +3522,6 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 ---- !u!114 &2797302821141521614 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3599769466313680341} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_SelectedTrigger: Selected - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 8426959644519684905} - m_OnClick: - m_PersistentCalls: - m_Calls: [] --- !u!1 &3638142815629788147 GameObject: m_ObjectHideFlags: 0 @@ -5112,7 +4899,19 @@ MonoBehaviour: m_TargetGraphic: {fileID: 1165031287013658271} m_OnClick: m_PersistentCalls: - m_Calls: [] + m_Calls: + - m_Target: {fileID: 6017598305918751662} + m_TargetAssemblyTypeName: TON.ShopUI, Assembly-CSharp + m_MethodName: OnClickBuyHpPotion20Button + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 --- !u!1 &4868072788066043443 GameObject: m_ObjectHideFlags: 0 @@ -6218,7 +6017,19 @@ MonoBehaviour: m_TargetGraphic: {fileID: 9206748816613213675} m_OnClick: m_PersistentCalls: - m_Calls: [] + m_Calls: + - m_Target: {fileID: 6017598305918751662} + m_TargetAssemblyTypeName: TON.ShopUI, Assembly-CSharp + m_MethodName: OnClickBuyMpPotion20Button + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 --- !u!1 &6313487851789293729 GameObject: m_ObjectHideFlags: 0 @@ -7244,9 +7055,8 @@ GameObject: - component: {fileID: 8456287251216652549} - component: {fileID: 7978602533984118169} - component: {fileID: 5872006662284563241} - - component: {fileID: 1958380828545901933} m_Layer: 5 - m_Name: ItemButton (5) + m_Name: MPPosion20 m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -7310,50 +7120,6 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 ---- !u!114 &1958380828545901933 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7242532085717922559} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_SelectedTrigger: Selected - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 5872006662284563241} - m_OnClick: - m_PersistentCalls: - m_Calls: [] --- !u!1 &7274226733673243529 GameObject: m_ObjectHideFlags: 0 @@ -7480,7 +7246,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &2640998817256912009 RectTransform: m_ObjectHideFlags: 0 @@ -8028,8 +7794,12 @@ MonoBehaviour: m_EditorClassIdentifier: HeartPopUp: {fileID: 7274226733673243529} PositionPopUp: {fileID: 7383083170921283796} - hpPotionPrice: 100 - mpPotionPrice: 150 + hpPotionPrice1: 200 + hpPotionPrice5: 1000 + hpPotionPrice20: 3600 + mpPotionPrice1: 400 + mpPotionPrice5: 2000 + mpPotionPrice20: 7600 --- !u!1 &7628793256781534853 GameObject: m_ObjectHideFlags: 0 @@ -9149,7 +8919,7 @@ MonoBehaviour: m_Calls: - m_Target: {fileID: 6017598305918751662} m_TargetAssemblyTypeName: TON.ShopUI, Assembly-CSharp - m_MethodName: OnClickBuyHpPotionButton + m_MethodName: OnClickBuyHpPotion1Button m_Mode: 1 m_Arguments: m_ObjectArgument: {fileID: 0} @@ -9839,7 +9609,19 @@ MonoBehaviour: m_TargetGraphic: {fileID: 3074325309550945321} m_OnClick: m_PersistentCalls: - m_Calls: [] + m_Calls: + - m_Target: {fileID: 6017598305918751662} + m_TargetAssemblyTypeName: TON.ShopUI, Assembly-CSharp + m_MethodName: OnClickBuyHpPotion5Button + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 --- !u!1 &9075461224054751706 GameObject: m_ObjectHideFlags: 0 diff --git a/Gameton-06/Assets/Gameton/Scripts/UI/ShopUI.cs b/Gameton-06/Assets/Gameton/Scripts/UI/ShopUI.cs index e16d96da..e5c0b7c8 100644 --- a/Gameton-06/Assets/Gameton/Scripts/UI/ShopUI.cs +++ b/Gameton-06/Assets/Gameton/Scripts/UI/ShopUI.cs @@ -11,8 +11,12 @@ namespace TON [SerializeField] private GameObject HeartPopUp; [SerializeField] private GameObject PositionPopUp; - [SerializeField] private int hpPotionPrice = 200; // HP 포션 가격 - [SerializeField] private int mpPotionPrice = 400; // MP 포션 가격 + [SerializeField] private int hpPotionPrice1 = 200; // HP 포션 가격 + [SerializeField] private int hpPotionPrice5 = 1000; // HP 포션 가격 + [SerializeField] private int hpPotionPrice20 = 3600; // HP 포션 가격 + [SerializeField] private int mpPotionPrice1 = 400; // MP 포션 가격 + [SerializeField] private int mpPotionPrice5 = 2000; // MP 포션 가격 + [SerializeField] private int mpPotionPrice20 = 7600; // MP 포션 가격 private PlayerDataManager playerDataManager; @@ -69,40 +73,72 @@ namespace TON } // HP 포션 구매 버튼 클릭 시 호출 - public void OnClickBuyHpPotionButton() + public void OnClickBuyHpPotion1Button() { - if ((playerDataManager.goldAmount) >= hpPotionPrice) + if ((playerDataManager.goldAmount) >= hpPotionPrice1) { // 골드 차감 및 HP 포션 증가 - playerDataManager.UseGold(hpPotionPrice); + playerDataManager.UseGold(hpPotionPrice1); playerDataManager.userItem.hpPotion += 1; - Debug.Log($"HP 포션 구매 성공! 남은 골드: {playerDataManager.goldAmount}, HP 포션 수량: {playerDataManager.userItem.hpPotion}"); + // Debug.Log($"HP 포션 구매 성공! 남은 골드: {playerDataManager.goldAmount}, HP 포션 수량: {playerDataManager.userItem.hpPotion}"); } - else + } // HP 포션 구매 버튼 클릭 시 호출 + public void OnClickBuyHpPotion5Button() + { + if ((playerDataManager.goldAmount) >= hpPotionPrice5) { - Debug.Log("골드가 부족합니다!"); - // 골드 부족 팝업 표시 가능 - UIManager.Show(UIList.GoldPopup); + // 골드 차감 및 HP 포션 증가 + playerDataManager.UseGold(hpPotionPrice5); + playerDataManager.userItem.hpPotion += 5; + + // Debug.Log($"HP 포션 구매 성공! 남은 골드: {playerDataManager.goldAmount}, HP 포션 수량: {playerDataManager.userItem.hpPotion}"); + } + } // HP 포션 구매 버튼 클릭 시 호출 + public void OnClickBuyHpPotion20Button() + { + if ((playerDataManager.goldAmount) >= hpPotionPrice20) + { + // 골드 차감 및 HP 포션 증가 + playerDataManager.UseGold(hpPotionPrice20); + playerDataManager.userItem.hpPotion += 20; + + // Debug.Log($"HP 포션 구매 성공! 남은 골드: {playerDataManager.goldAmount}, HP 포션 수량: {playerDataManager.userItem.hpPotion}"); } } // MP 포션 구매 버튼 클릭 시 호출 - public void OnClickBuyMpPotionButton() + public void OnClickBuyMpPotion1Button() { - if (playerDataManager.goldAmount >= mpPotionPrice) + if (playerDataManager.goldAmount >= mpPotionPrice1) { // 골드 차감 및 MP 포션 증가 - playerDataManager.UseGold(mpPotionPrice); + playerDataManager.UseGold(mpPotionPrice1); playerDataManager.userItem.mpPotion += 1; - Debug.Log($"MP 포션 구매 성공! 남은 골드: {playerDataManager.goldAmount}, MP 포션 수량: {playerDataManager.userItem.mpPotion}"); + // Debug.Log($"MP 포션 구매 성공! 남은 골드: {playerDataManager.goldAmount}, MP 포션 수량: {playerDataManager.userItem.mpPotion}"); } - else + } // MP 포션 구매 버튼 클릭 시 호출 + public void OnClickBuyMpPotion5Button() + { + if (playerDataManager.goldAmount >= mpPotionPrice5) { - Debug.Log("골드가 부족합니다!"); - // 골드 부족 팝업 표시 가능 - UIManager.Show(UIList.GoldPopup); + // 골드 차감 및 MP 포션 증가 + playerDataManager.UseGold(mpPotionPrice5); + playerDataManager.userItem.mpPotion += 1; + + // Debug.Log($"MP 포션 구매 성공! 남은 골드: {playerDataManager.goldAmount}, MP 포션 수량: {playerDataManager.userItem.mpPotion}"); + } + } // MP 포션 구매 버튼 클릭 시 호출 + public void OnClickBuyMpPotion20Button() + { + if (playerDataManager.goldAmount >= mpPotionPrice20) + { + // 골드 차감 및 MP 포션 증가 + playerDataManager.UseGold(mpPotionPrice20); + playerDataManager.userItem.mpPotion += 1; + + // Debug.Log($"MP 포션 구매 성공! 남은 골드: {playerDataManager.goldAmount}, MP 포션 수량: {playerDataManager.userItem.mpPotion}"); } } }