add back booster pack giver
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user