Files
AppleHillsProduction/Assets/Scripts/UI/DivingGameOverScreen.cs

33 lines
835 B
C#
Raw Normal View History

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;
2025-10-16 22:35:23 +02:00
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
2025-10-16 23:59:25 +02:00
void OnEnable()
{
if (DivingGameManager.Instance != null)
{
int finalScore = DivingGameManager.Instance.PlayerScore;
finalScoreText.text = $"{finalScore}";
}
}
public async void PlayAgain()
2025-10-16 22:35:23 +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);
}
}