Add boosters to minigame again

This commit is contained in:
Michal Pikulski
2025-11-07 17:26:25 +01:00
parent ea12766cf7
commit 2127bf37b2
4 changed files with 193 additions and 43 deletions

View File

@@ -206,7 +206,10 @@ namespace Cinematics
}
public void ShowGameOverScreen()
{
{
// Diagnostic: log time and call stack to track when/why game over is triggered
Logging.Debug($"[CinematicsManager] ShowGameOverScreen called at time={Time.time:F2}");
if (divingGameOverScreen != null && UIPageController.Instance != null)
{
UIPageController.Instance.PushPage(divingGameOverScreen);

View File

@@ -668,16 +668,20 @@ namespace Minigames.DivingForPictures
if (giver != null)
{
UIPageController.Instance.ShowAllUI();
giver.GiveBooster(() => { completed = true; });
Logging.Debug("[DivingGameManager] Starting booster giver sequence");
giver.GiveBooster(() =>
{
completed = true;
Logging.Debug("[DivingGameManager] Booster giver completed callback received");
});
// 2) Wait for it to finish (with a safety timeout in case it's not wired)
float timeout = 10f; // fallback to avoid blocking forever
float elapsed = 0f;
while (!completed && elapsed < timeout)
// 2) Wait for it to finish (NO timeout - wait indefinitely for user interaction)
while (!completed)
{
elapsed += Time.unscaledDeltaTime;
yield return null;
}
Logging.Debug("[DivingGameManager] Booster giver sequence finished, proceeding to game over");
}
else
{