[SerializeField] GameObject OverScreen;
[SerializeField] Textual content SecondsText;
[SerializeField] Textual content HighScoreText;
[SerializeField] float Rating;
[SerializeField] float highscore;
personal void Begin()
{
FindObjectOfType<CoreBlock>().OnPlayerDeath += OnGameOver;
Rating = Time.time;
}
personal void Replace()
{
if((Rating > highscore))
PlayerPrefs.SetFloat("Excessive Rating", Rating);
}
void OnGameOver()
{
OverScreen.SetActive(true);
SecondsText.textual content = Mathf.RoundToInt(Time.timeSinceLevelLoad).ToString();
HighScoreText.textual content = highscore.ToString();
}
public void ResetGame()
{
SceneManager.LoadScene(1);
}
My excessive rating retains getting “added” by my rating. Time.time will maintain ticking up so long as the appliance is operating, so if i have to show the highscore, i’ve to seize the time at gameover. proper? but when so, how? thanks upfront