fix: 상점에서 포션을 구매했지만 데이터가 갱신되지 않는 오류 수정
This commit is contained in:
@@ -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)
|
public void AddGold(int amount)
|
||||||
{
|
{
|
||||||
goldAmount += amount;
|
goldAmount += amount;
|
||||||
|
|||||||
@@ -43,11 +43,11 @@ namespace TON
|
|||||||
{
|
{
|
||||||
if (potionType == "hp")
|
if (potionType == "hp")
|
||||||
{
|
{
|
||||||
playerDataManager.userItem.hpPotion += quantity;
|
playerDataManager.AddPotion("HP", quantity);
|
||||||
}
|
}
|
||||||
else if (potionType == "mp")
|
else if (potionType == "mp")
|
||||||
{
|
{
|
||||||
playerDataManager.userItem.mpPotion += quantity;
|
playerDataManager.AddPotion("MP", quantity);
|
||||||
}
|
}
|
||||||
|
|
||||||
UIManager.Singleton.UpdateCashData();
|
UIManager.Singleton.UpdateCashData();
|
||||||
|
|||||||
Reference in New Issue
Block a user