fix: 플레이어 골드 재화 사용 콜백 함수 적용
This commit is contained in:
@@ -97,11 +97,12 @@ namespace TON
|
|||||||
// UpdateUI();
|
// UpdateUI();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
public void UseGold(int amount)
|
public void UseGold(int amount, System.Action<bool> callback)
|
||||||
{
|
{
|
||||||
if (goldAmount - amount < 0)
|
if (goldAmount - amount < 0)
|
||||||
{
|
{
|
||||||
// 골드 재화 사용 불가 팝업
|
// 골드 재화 사용 불가 팝업
|
||||||
|
callback?.Invoke(false);
|
||||||
UIManager.Show<GoldPopup>(UIList.GoldPopup);
|
UIManager.Show<GoldPopup>(UIList.GoldPopup);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -109,8 +110,7 @@ namespace TON
|
|||||||
goldAmount -= amount;
|
goldAmount -= amount;
|
||||||
cashDataManager.UpdateGoldData(goldAmount, updatedData =>
|
cashDataManager.UpdateGoldData(goldAmount, updatedData =>
|
||||||
{
|
{
|
||||||
// TODO: UI 업데이트 로직 적용
|
callback?.Invoke(true);
|
||||||
// UpdateUI();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user