상점 구매 관련 수정 및 비율에 따른 UI 닫기 버튼과 캐시 UI 겹치는 문제 수정

This commit is contained in:
Mingu Kim
2025-03-10 01:19:28 +09:00
parent 93d9bbc9ab
commit 56a82823c6
2 changed files with 124 additions and 47 deletions

View File

@@ -1161,7 +1161,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 697, y: 348.55} m_AnchoredPosition: {x: 701, y: 300.13}
m_SizeDelta: {x: 82.9076, y: 82.9076} m_SizeDelta: {x: 82.9076, y: 82.9076}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2295341844210809407 --- !u!222 &2295341844210809407
@@ -1562,7 +1562,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 700, y: 351.26} m_AnchoredPosition: {x: 705, y: 302.84}
m_SizeDelta: {x: 83.4802, y: 83.4802} m_SizeDelta: {x: 83.4802, y: 83.4802}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7540376593940388836 --- !u!222 &7540376593940388836
@@ -1770,7 +1770,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 700, y: 351.26} m_AnchoredPosition: {x: 702, y: 302.84}
m_SizeDelta: {x: 83.4802, y: 83.4802} m_SizeDelta: {x: 83.4802, y: 83.4802}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8058790877832022744 --- !u!222 &8058790877832022744
@@ -14445,7 +14445,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 700, y: 351.26} m_AnchoredPosition: {x: 702, y: 302.84}
m_SizeDelta: {x: 83.4802, y: 83.4802} m_SizeDelta: {x: 83.4802, y: 83.4802}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2053842356100037995 --- !u!222 &2053842356100037995
@@ -15707,7 +15707,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 700, y: 351.26} m_AnchoredPosition: {x: 702, y: 302.84}
m_SizeDelta: {x: 83.4802, y: 83.4802} m_SizeDelta: {x: 83.4802, y: 83.4802}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1593487139608649043 --- !u!222 &1593487139608649043
@@ -16271,7 +16271,7 @@ GameObject:
- component: {fileID: 2951673025772393905} - component: {fileID: 2951673025772393905}
- component: {fileID: 3705323438841518151} - component: {fileID: 3705323438841518151}
m_Layer: 5 m_Layer: 5
m_Name: BackButton (1) m_Name: RouleetteButton
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
@@ -16293,7 +16293,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5} m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5} m_AnchorMax: {x: 0, y: 0.5}
m_AnchoredPosition: {x: 1835, y: 0} m_AnchoredPosition: {x: 2000, y: 0}
m_SizeDelta: {x: 100, y: 100} m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7576472329908582260 --- !u!222 &7576472329908582260
@@ -17541,7 +17541,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 697, y: 348.55} m_AnchoredPosition: {x: 701, y: 300.13}
m_SizeDelta: {x: 82.9076, y: 82.9076} m_SizeDelta: {x: 82.9076, y: 82.9076}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &236073453869866574 --- !u!222 &236073453869866574
@@ -27335,7 +27335,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 848, y: 390} m_AnchoredPosition: {x: 853, y: 302.84}
m_SizeDelta: {x: 83.4802, y: 83.4802} m_SizeDelta: {x: 83.4802, y: 83.4802}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &520302995855237017 --- !u!222 &520302995855237017

View File

@@ -72,38 +72,75 @@ namespace TON
PositionPopUp.SetActive(false); PositionPopUp.SetActive(false);
} }
// HP 포션 구매 버튼 클릭 시 호출
public void OnClickBuyHpPotion1Button() public void OnClickBuyHpPotion1Button()
{ {
if ((playerDataManager.goldAmount) >= hpPotionPrice1) if (playerDataManager.goldAmount >= hpPotionPrice1)
{ {
// 골드 차감 및 HP 포션 증가 playerDataManager.UseGold(hpPotionPrice1, (isSuccess) =>
playerDataManager.UseGold(hpPotionPrice1); {
playerDataManager.userItem.hpPotion += 1; if (isSuccess)
{
// Debug.Log($"HP 포션 구매 성공! 남은 골드: {playerDataManager.goldAmount}, HP 포션 수량: {playerDataManager.userItem.hpPotion}"); playerDataManager.userItem.hpPotion += 1;
Debug.Log($"HP 포션 구매 성공! 남은 골드: {playerDataManager.goldAmount}, HP 포션 수량: {playerDataManager.userItem.hpPotion}");
UIManager.Singleton.UpdateCashData();
}
else
{
Debug.Log("골드가 부족하여 HP 포션 구매 실패!");
}
});
} }
} // HP 포션 구매 버튼 클릭 시 호출 else
{
Debug.Log("골드가 부족합니다!");
}
}
public void OnClickBuyHpPotion5Button() public void OnClickBuyHpPotion5Button()
{ {
if ((playerDataManager.goldAmount) >= hpPotionPrice5) if (playerDataManager.goldAmount >= hpPotionPrice5)
{ {
// 골드 차감 및 HP 포션 증가 playerDataManager.UseGold(hpPotionPrice5, (isSuccess) =>
playerDataManager.UseGold(hpPotionPrice5); {
playerDataManager.userItem.hpPotion += 5; if (isSuccess)
{
// Debug.Log($"HP 포션 구매 성공! 남은 골드: {playerDataManager.goldAmount}, HP 포션 수량: {playerDataManager.userItem.hpPotion}"); playerDataManager.userItem.hpPotion += 5;
Debug.Log($"HP 포션 구매 성공! 남은 골드: {playerDataManager.goldAmount}, HP 포션 수량: {playerDataManager.userItem.hpPotion}");
UIManager.Singleton.UpdateCashData();
}
else
{
Debug.Log("골드가 부족하여 HP 포션 구매 실패!");
}
});
} }
} // HP 포션 구매 버튼 클릭 시 호출 else
{
Debug.Log("골드가 부족합니다!");
}
}
public void OnClickBuyHpPotion20Button() public void OnClickBuyHpPotion20Button()
{ {
if ((playerDataManager.goldAmount) >= hpPotionPrice20) if (playerDataManager.goldAmount >= hpPotionPrice20)
{ {
// 골드 차감 및 HP 포션 증가 playerDataManager.UseGold(hpPotionPrice20, (isSuccess) =>
playerDataManager.UseGold(hpPotionPrice20); {
playerDataManager.userItem.hpPotion += 20; if (isSuccess)
{
// Debug.Log($"HP 포션 구매 성공! 남은 골드: {playerDataManager.goldAmount}, HP 포션 수량: {playerDataManager.userItem.hpPotion}"); playerDataManager.userItem.hpPotion += 20;
Debug.Log($"HP 포션 구매 성공! 남은 골드: {playerDataManager.goldAmount}, HP 포션 수량: {playerDataManager.userItem.hpPotion}");
UIManager.Singleton.UpdateCashData();
}
else
{
Debug.Log("골드가 부족하여 HP 포션 구매 실패!");
}
});
}
else
{
Debug.Log("골드가 부족합니다!");
} }
} }
@@ -112,33 +149,73 @@ namespace TON
{ {
if (playerDataManager.goldAmount >= mpPotionPrice1) if (playerDataManager.goldAmount >= mpPotionPrice1)
{ {
// 골드 차감 및 MP 포션 증가 playerDataManager.UseGold(mpPotionPrice1, (isSuccess) =>
playerDataManager.UseGold(mpPotionPrice1); {
playerDataManager.userItem.mpPotion += 1; if (isSuccess)
{
// Debug.Log($"MP 포션 구매 성공! 남은 골드: {playerDataManager.goldAmount}, MP 포션 수량: {playerDataManager.userItem.mpPotion}"); playerDataManager.userItem.mpPotion += 1;
Debug.Log($"MP 포션 구매 성공! 남은 골드: {playerDataManager.goldAmount}, MP 포션 수량: {playerDataManager.userItem.mpPotion}");
UIManager.Singleton.UpdateCashData();
}
else
{
Debug.Log("골드가 부족하여 MP 포션 구매 실패!");
}
});
} }
} // MP 포션 구매 버튼 클릭 시 호출 else
{
Debug.Log("골드가 부족합니다!");
}
}
// MP 포션 구매 버튼 클릭 시 호출
public void OnClickBuyMpPotion5Button() public void OnClickBuyMpPotion5Button()
{ {
if (playerDataManager.goldAmount >= mpPotionPrice5) if (playerDataManager.goldAmount >= mpPotionPrice5)
{ {
// 골드 차감 및 MP 포션 증가 playerDataManager.UseGold(mpPotionPrice5, (isSuccess) =>
playerDataManager.UseGold(mpPotionPrice5); {
playerDataManager.userItem.mpPotion += 1; if (isSuccess)
{
// Debug.Log($"MP 포션 구매 성공! 남은 골드: {playerDataManager.goldAmount}, MP 포션 수량: {playerDataManager.userItem.mpPotion}"); playerDataManager.userItem.mpPotion += 5;
Debug.Log($"MP 포션 구매 성공! 남은 골드: {playerDataManager.goldAmount}, MP 포션 수량: {playerDataManager.userItem.mpPotion}");
UIManager.Singleton.UpdateCashData();
}
else
{
Debug.Log("골드가 부족하여 MP 포션 구매 실패!");
}
});
} }
} // MP 포션 구매 버튼 클릭 시 호출 else
{
Debug.Log("골드가 부족합니다!");
}
}
// MP 포션 구매 버튼 클릭 시 호출
public void OnClickBuyMpPotion20Button() public void OnClickBuyMpPotion20Button()
{ {
if (playerDataManager.goldAmount >= mpPotionPrice20) if (playerDataManager.goldAmount >= mpPotionPrice20)
{ {
// 골드 차감 및 MP 포션 증가 playerDataManager.UseGold(mpPotionPrice20, (isSuccess) =>
playerDataManager.UseGold(mpPotionPrice20); {
playerDataManager.userItem.mpPotion += 1; if (isSuccess)
{
// Debug.Log($"MP 포션 구매 성공! 남은 골드: {playerDataManager.goldAmount}, MP 포션 수량: {playerDataManager.userItem.mpPotion}"); playerDataManager.userItem.mpPotion += 20;
Debug.Log($"MP 포션 구매 성공! 남은 골드: {playerDataManager.goldAmount}, MP 포션 수량: {playerDataManager.userItem.mpPotion}");
UIManager.Singleton.UpdateCashData();
}
else
{
Debug.Log("골드가 부족하여 MP 포션 구매 실패!");
}
});
}
else
{
Debug.Log("골드가 부족합니다!");
} }
} }
} }