add back booster pack giver

This commit is contained in:
Michal Pikulski
2025-11-07 16:37:28 +01:00
parent 89cb131b94
commit ba2c1f5310
7 changed files with 970 additions and 58 deletions

View File

@@ -662,18 +662,14 @@ namespace Minigames.DivingForPictures
// 1) Call the booster pack giver if available
bool completed = false;
var giver = UI.CardSystem.BoosterPackGiver.Instance;
var giver = UI.CardSystem.MinigameBoosterGiver.Instance;
if (giver != null)
{
// Temporarily subscribe to completion
UnityAction onDone = null;
onDone = () => { completed = true; giver.OnCompleted.RemoveListener(onDone); };
giver.OnCompleted.AddListener(onDone);
UIPageController.Instance.ShowAllUI();
giver.GiveBoosterPack();
giver.GiveBooster(() => { completed = true; });
// 2) Wait for it to finish (with a safety timeout in case it's not wired)
float timeout = 5f; // fallback to avoid blocking forever
float timeout = 10f; // fallback to avoid blocking forever
float elapsed = 0f;
while (!completed && elapsed < timeout)
{
@@ -684,7 +680,7 @@ namespace Minigames.DivingForPictures
else
{
// If no giver is present, proceed immediately
Logging.Debug("[DivingGameManager] BoosterPackGiver not found; skipping booster animation.");
Logging.Debug("[DivingGameManager] MinigameBoosterGiver not found; skipping booster animation.");
}
// 3) Only then show the game over screen