49 lines
1.5 KiB
C#
49 lines
1.5 KiB
C#
using System;
|
|
using Core;
|
|
using UnityEngine;
|
|
using TMPro;
|
|
using Minigames.DivingForPictures;
|
|
|
|
public class DivingGameOverScreen : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private TextMeshProUGUI finalScoreText;
|
|
|
|
void OnEnable()
|
|
{
|
|
if (DivingGameManager.Instance != null)
|
|
{
|
|
int finalScore = DivingGameManager.Instance.PlayerScore;
|
|
finalScoreText.text = $"{finalScore}";
|
|
}
|
|
}
|
|
|
|
public async void PlayAgain()
|
|
{
|
|
var progress = new Progress<float>(p => Logging.Debug($"Loading progress: {p * 100:F0}%"));
|
|
await SceneManagerService.Instance.ReloadCurrentScene(progress);;
|
|
gameObject.SetActive(false);
|
|
}
|
|
|
|
/// <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);
|
|
}
|
|
} |