상점 UI 포션 창 추가

This commit is contained in:
Mingu Kim
2025-03-05 23:11:24 +09:00
parent 8f69ecc429
commit d479310359
4 changed files with 5000 additions and 119 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 40c6b690b3df650479462a8b53f074da guid: c85288aa6f7f4bd458221f6dd0bb593b
PrefabImporter: PrefabImporter:
externalObjects: {} externalObjects: {}
userData: userData:

View File

@@ -122,6 +122,235 @@ NavMeshSettings:
debug: debug:
m_Flags: 0 m_Flags: 0
m_NavMeshData: {fileID: 0} m_NavMeshData: {fileID: 0}
--- !u!21 &180126675
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: UI/RoundedCorners/RoundedCorners
m_Shader: {fileID: 4800000, guid: 0bd2ec5d73751e34a814274a454bec41, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _ColorMask: 15
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UseUIAlphaClip: 0
m_Colors:
- _OuterUV: {r: 0, g: 0, b: 1, a: 1}
- _WidthHeightRadius: {r: 1400, g: 659, b: 120, a: 0}
m_BuildTextureStacks: []
--- !u!21 &300361163
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: UI/RoundedCorners/RoundedCorners
m_Shader: {fileID: 4800000, guid: 0bd2ec5d73751e34a814274a454bec41, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _ColorMask: 15
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UseUIAlphaClip: 0
m_Colors:
- _OuterUV: {r: 0, g: 0, b: 1, a: 1}
- _WidthHeightRadius: {r: 1540, g: 736.3636, b: 120, a: 0}
m_BuildTextureStacks: []
--- !u!21 &329245328
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: UI/RoundedCorners/RoundedCorners
m_Shader: {fileID: 4800000, guid: 0bd2ec5d73751e34a814274a454bec41, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _ColorMask: 15
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UseUIAlphaClip: 0
m_Colors:
- _OuterUV: {r: 0, g: 0, b: 1, a: 1}
- _WidthHeightRadius: {r: 1400, g: 659, b: 120, a: 0}
m_BuildTextureStacks: []
--- !u!1001 &393904765
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 341810246022023015, guid: c85288aa6f7f4bd458221f6dd0bb593b, type: 3}
propertyPath: m_Pivot.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: c85288aa6f7f4bd458221f6dd0bb593b, type: 3}
propertyPath: m_Pivot.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: c85288aa6f7f4bd458221f6dd0bb593b, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: c85288aa6f7f4bd458221f6dd0bb593b, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: c85288aa6f7f4bd458221f6dd0bb593b, type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: c85288aa6f7f4bd458221f6dd0bb593b, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: c85288aa6f7f4bd458221f6dd0bb593b, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: c85288aa6f7f4bd458221f6dd0bb593b, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: c85288aa6f7f4bd458221f6dd0bb593b, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: c85288aa6f7f4bd458221f6dd0bb593b, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: c85288aa6f7f4bd458221f6dd0bb593b, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: c85288aa6f7f4bd458221f6dd0bb593b, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: c85288aa6f7f4bd458221f6dd0bb593b, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: c85288aa6f7f4bd458221f6dd0bb593b, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: c85288aa6f7f4bd458221f6dd0bb593b, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: c85288aa6f7f4bd458221f6dd0bb593b, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: c85288aa6f7f4bd458221f6dd0bb593b, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: c85288aa6f7f4bd458221f6dd0bb593b, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: c85288aa6f7f4bd458221f6dd0bb593b, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: c85288aa6f7f4bd458221f6dd0bb593b, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1061576736496806166, guid: c85288aa6f7f4bd458221f6dd0bb593b, type: 3}
propertyPath: m_Material
value:
objectReference: {fileID: 180126675}
- target: {fileID: 2302682071714074079, guid: c85288aa6f7f4bd458221f6dd0bb593b, type: 3}
propertyPath: m_Material
value:
objectReference: {fileID: 329245328}
- target: {fileID: 7548221306024544197, guid: c85288aa6f7f4bd458221f6dd0bb593b, type: 3}
propertyPath: m_Name
value: UI.ShopUI
objectReference: {fileID: 0}
- target: {fileID: 8106667211122060160, guid: c85288aa6f7f4bd458221f6dd0bb593b, type: 3}
propertyPath: m_Material
value:
objectReference: {fileID: 300361163}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c85288aa6f7f4bd458221f6dd0bb593b, type: 3}
--- !u!1 &490671891 --- !u!1 &490671891
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -214,122 +443,9 @@ Transform:
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &6852389222377362033
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 341810246022023015, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
propertyPath: m_Pivot.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
propertyPath: m_Pivot.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 341810246022023015, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2543191857787144860, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
propertyPath: m_SizeDelta.x
value: 100
objectReference: {fileID: 0}
- target: {fileID: 2543191857787144860, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
propertyPath: m_SizeDelta.y
value: 100
objectReference: {fileID: 0}
- target: {fileID: 2543191857787144860, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
propertyPath: m_AnchoredPosition.x
value: -882.3
objectReference: {fileID: 0}
- target: {fileID: 2543191857787144860, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
propertyPath: m_AnchoredPosition.y
value: 447.5
objectReference: {fileID: 0}
- target: {fileID: 7548221306024544197, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
propertyPath: m_Name
value: UI.ShopUI
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 40c6b690b3df650479462a8b53f074da, type: 3}
--- !u!1660057539 &9223372036854775807 --- !u!1660057539 &9223372036854775807
SceneRoots: SceneRoots:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
m_Roots: m_Roots:
- {fileID: 490671894} - {fileID: 490671894}
- {fileID: 6852389222377362033} - {fileID: 393904765}

View File

@@ -9,20 +9,31 @@ namespace TON
public class ShopUI : UIBase public class ShopUI : UIBase
{ {
[SerializeField] private GameObject HeartPopUp; [SerializeField] private GameObject HeartPopUp;
[SerializeField] private GameObject PositionPopUp;
// // 보유 포션 수량 [SerializeField] private int hpPotionPrice = 200; // HP 포션 가격
// [SerializeField] private TextMeshProUGUI hpPotionCount; [SerializeField] private int mpPotionPrice = 400; // MP 포션 가격
// [SerializeField] private TextMeshProUGUI mpPotionCount;
private PlayerDataManager playerDataManager;
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
{ {
InitPopUpActive(); InitPopUpActive();
// 싱글톤으로 PlayerDataManager 접근
playerDataManager = PlayerDataManager.Singleton;
if (playerDataManager == null)
{
Debug.LogError("PlayerDataManager가 초기화되지 않았습니다.");
}
} }
public void InitPopUpActive() public void InitPopUpActive()
{ {
HeartPopUp.SetActive(false); HeartPopUp.SetActive(false);
PositionPopUp.SetActive(false);
} }
// Update is called once per frame // Update is called once per frame
@@ -46,5 +57,53 @@ namespace TON
{ {
HeartPopUp.SetActive(false); HeartPopUp.SetActive(false);
} }
public void OnClickPositionPopUpButton()
{
PositionPopUp.SetActive(true);
}
public void OnClickPositionCloseButton()
{
PositionPopUp.SetActive(false);
}
// HP 포션 구매 버튼 클릭 시 호출
public void OnClickBuyHpPotionButton()
{
if ((playerDataManager.goldAmount) >= hpPotionPrice)
{
// 골드 차감 및 HP 포션 증가
playerDataManager.UseGold(hpPotionPrice);
playerDataManager.userItem.hpPotion += 1;
Debug.Log($"HP 포션 구매 성공! 남은 골드: {playerDataManager.goldAmount}, HP 포션 수량: {playerDataManager.userItem.hpPotion}");
}
else
{
Debug.Log("골드가 부족합니다!");
// 골드 부족 팝업 표시 가능
UIManager.Show<GoldPopup>(UIList.GoldPopup);
}
}
// MP 포션 구매 버튼 클릭 시 호출
public void OnClickBuyMpPotionButton()
{
if (playerDataManager.goldAmount >= mpPotionPrice)
{
// 골드 차감 및 MP 포션 증가
playerDataManager.UseGold(mpPotionPrice);
playerDataManager.userItem.mpPotion += 1;
Debug.Log($"MP 포션 구매 성공! 남은 골드: {playerDataManager.goldAmount}, MP 포션 수량: {playerDataManager.userItem.mpPotion}");
}
else
{
Debug.Log("골드가 부족합니다!");
// 골드 부족 팝업 표시 가능
UIManager.Show<GoldPopup>(UIList.GoldPopup);
}
}
} }
} }