fix: 상점에서 포션을 구매했지만 데이터가 갱신되지 않는 오류 수정

This commit is contained in:
aube.lee
2025-03-14 20:06:47 +09:00
parent cec4998590
commit 14c39bb265
2 changed files with 24 additions and 9 deletions

View File

@@ -88,6 +88,21 @@ namespace TON
}
}
public void AddPotion(string type, int amount)
{
switch (type)
{
case "HP":
userItem.hpPotion += amount;
itemDataManager.UpdateHpData(userItem.hpPotion);
break;
case "MP":
userItem.mpPotion += amount;
itemDataManager.UpdateMpData(userItem.mpPotion);
break;
}
}
public void AddGold(int amount)
{
goldAmount += amount;

View File

@@ -43,11 +43,11 @@ namespace TON
{
if (potionType == "hp")
{
playerDataManager.userItem.hpPotion += quantity;
playerDataManager.AddPotion("HP", quantity);
}
else if (potionType == "mp")
{
playerDataManager.userItem.mpPotion += quantity;
playerDataManager.AddPotion("MP", quantity);
}
UIManager.Singleton.UpdateCashData();