From dbbb38d2b63ca2e4869232290983c1ec1bcb7355 Mon Sep 17 00:00:00 2001 From: bayusamudra5502 <bayusamudra.55.02.com@gmail.com> Date: Sun, 16 Apr 2023 14:26:15 +0700 Subject: [PATCH] fix: time scoreboard --- Assets/Scripts/Dialogue/GameOverUI.cs | 2 +- Assets/Scripts/Highscore/HighscoreTable.cs | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/Dialogue/GameOverUI.cs b/Assets/Scripts/Dialogue/GameOverUI.cs index 16a75c7..d8d71bb 100644 --- a/Assets/Scripts/Dialogue/GameOverUI.cs +++ b/Assets/Scripts/Dialogue/GameOverUI.cs @@ -26,7 +26,7 @@ public class GameOverUI : MonoBehaviour if(isEnabled) { Debug.Log("Go to opening"); - SceneManager.LoadScene("Opening"); + SceneManager.LoadScene(SceneManager.GetActiveScene().name); } } } diff --git a/Assets/Scripts/Highscore/HighscoreTable.cs b/Assets/Scripts/Highscore/HighscoreTable.cs index ede4cbb..35bec7f 100644 --- a/Assets/Scripts/Highscore/HighscoreTable.cs +++ b/Assets/Scripts/Highscore/HighscoreTable.cs @@ -1,8 +1,7 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; -using UnityEngine.UI; - +using UnityEngine.UI; public class HighscoreTable : MonoBehaviour { private Transform entryContainer; @@ -22,9 +21,9 @@ public class HighscoreTable : MonoBehaviour { MainManager mainManager = GameObject.Find("MainManager").GetComponent<MainManager>(); if(mainManager.time > 0) - { - int secs = mainManager.time % 60; - int mins = mainManager.time / 60; + { + int secs = (mainManager.time % 60_000)/1000; + int mins = mainManager.time / 60_000; AddHighscoreEntry(mins, secs, PlayerPrefs.GetString("playerName")); } UpdateUI(); -- GitLab