FIx the issue of end game screen appearing twice
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user