fix: 플레이어 골드 재화 사용 콜백 함수 적용

This commit is contained in:
aube.lee
2025-03-10 00:50:10 +09:00
parent 573eb2f1e1
commit 3fdc3bfac8

View File

@@ -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();
}); });
} }