FIx the issue of end game screen appearing twice

This commit is contained in:
Michal Adam Pikulski
2025-10-22 11:50:24 +02:00
parent 1cf8076488
commit 35acaddca5
3 changed files with 13 additions and 835 deletions

File diff suppressed because one or more lines are too long

View File

@@ -686,6 +686,8 @@ namespace Minigames.DivingForPictures
// Call this when the game ends
public void EndGame()
{
// TODO: Investigate why called twice
CinematicsManager.Instance.OnCinematicStopped -= EndGame;
// Start the end game sequence that grants a booster, waits for the UI animation, then shows Game Over.
StartCoroutine(EndGameSequence());
}

View File

@@ -24,10 +24,11 @@ namespace UI
if (canvasGroup == null)
canvasGroup = gameObject.AddComponent<CanvasGroup>();
// Start invisible but keep the GameObject active so we can control visibility with alpha
canvasGroup.alpha = 0f;
canvasGroup.interactable = false;
canvasGroup.blocksRaycasts = false;
gameObject.SetActive(false);
// Don't disable the GameObject - let UIPageController handle that
}
/// <summary>