Make the score display a UIPage as well

This commit is contained in:
Michal Adam Pikulski
2025-10-22 10:37:51 +02:00
parent acf3ecec3f
commit 8591490cb2
7 changed files with 820 additions and 803 deletions

View File

@@ -2,12 +2,14 @@ using System;
using System.Collections.Generic;
using Bootstrap;
using Core;
using UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.Playables;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using UI.Core;
namespace Cinematics
{
@@ -25,7 +27,7 @@ namespace Cinematics
private bool _isCinematicPlaying = false;
public bool IsCinematicPlaying => _isCinematicPlaying;
public GameObject cinematicBackground;
public GameObject divingGameOverScreen;
public DivingGameOverScreen divingGameOverScreen;
// Dictionary to track addressable handles by PlayableDirector
private Dictionary<PlayableDirector, AsyncOperationHandle<PlayableAsset>> _addressableHandles
@@ -204,7 +206,20 @@ namespace Cinematics
public void ShowGameOverScreen()
{
divingGameOverScreen.SetActive(true);
if (divingGameOverScreen != null && UIPageController.Instance != null)
{
UIPageController.Instance.PushPage(divingGameOverScreen);
}
else if (divingGameOverScreen != null)
{
// Fallback if UIPageController is not available
divingGameOverScreen.gameObject.SetActive(true);
Logging.Warning("[CinematicsManager] UIPageController not found, falling back to simple activation.");
}
else
{
Logging.Warning("[CinematicsManager] DivingGameOverScreen reference is not set!");
}
}
}
}