2025-10-16 23:19:33 +02:00
|
|
|
using System;
|
2025-10-16 22:35:23 +02:00
|
|
|
using Core;
|
|
|
|
|
using UnityEngine;
|
2025-10-16 23:59:25 +02:00
|
|
|
using TMPro;
|
|
|
|
|
using Minigames.DivingForPictures;
|
2025-10-16 22:35:23 +02:00
|
|
|
|
|
|
|
|
public class DivingGameOverScreen : MonoBehaviour
|
|
|
|
|
{
|
2025-10-16 23:59:25 +02:00
|
|
|
[SerializeField]
|
|
|
|
|
private TextMeshProUGUI finalScoreText;
|
|
|
|
|
|
|
|
|
|
void OnEnable()
|
|
|
|
|
{
|
|
|
|
|
if (DivingGameManager.Instance != null)
|
|
|
|
|
{
|
|
|
|
|
int finalScore = DivingGameManager.Instance.PlayerScore;
|
|
|
|
|
finalScoreText.text = $"{finalScore}";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-16 23:19:33 +02:00
|
|
|
public async void PlayAgain()
|
2025-10-16 22:35:23 +02:00
|
|
|
{
|
2025-10-16 23:19:33 +02:00
|
|
|
var progress = new Progress<float>(p => Logging.Debug($"Loading progress: {p * 100:F0}%"));
|
|
|
|
|
await SceneManagerService.Instance.ReloadCurrentScene(progress);;
|
2025-10-16 22:35:23 +02:00
|
|
|
gameObject.SetActive(false);
|
|
|
|
|
}
|
2025-10-17 14:28:13 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Exits to the main menu scene.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public async void ExitToAppleHills()
|
|
|
|
|
{
|
|
|
|
|
gameObject.SetActive(false);
|
|
|
|
|
// Replace with the actual scene name as set in Build Settings
|
|
|
|
|
var progress = new Progress<float>(p => Logging.Debug($"Loading progress: {p * 100:F0}%"));
|
|
|
|
|
await SceneManagerService.Instance.SwitchSceneAsync("AppleHillsOverworld", progress);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Exits to the main menu scene.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public async void ExitToQuarry()
|
|
|
|
|
{
|
|
|
|
|
gameObject.SetActive(false);
|
|
|
|
|
// Replace with the actual scene name as set in Build Settings
|
|
|
|
|
var progress = new Progress<float>(p => Logging.Debug($"Loading progress: {p * 100:F0}%"));
|
|
|
|
|
await SceneManagerService.Instance.SwitchSceneAsync("Quarry", progress);
|
|
|
|
|
}
|
2025-10-16 23:19:33 +02:00
|
|
|
}
|