Add score to FortFight, clean up the resets

This commit is contained in:
Michal Pikulski
2025-12-19 16:26:46 +01:00
parent a9df9487f1
commit 5a5c379f1f
3 changed files with 131 additions and 13 deletions

View File

@@ -1,4 +1,5 @@
using Core;
using System;
using Core;
using Core.Lifecycle;
using TMPro;
using UnityEngine;
@@ -220,12 +221,10 @@ namespace Minigames.FortFight.UI
/// <summary>
/// Restart the game by reloading the current scene
/// </summary>
private void RestartGame()
private async void RestartGame()
{
// Use Unity's SceneManager to reload current scene
string currentScene = UnityEngine.SceneManagement.SceneManager.GetActiveScene().name;
Logging.Debug($"[GameOverUI] Reloading scene: {currentScene}");
UnityEngine.SceneManagement.SceneManager.LoadScene(currentScene);
var progress = new Progress<float>(p => Logging.Debug($"Loading progress: {p * 100:F0}%"));
await SceneManagerService.Instance.ReloadCurrentScene(progress);
}
#endregion