A way to move "Highscore" Text to Game Over Screen?

Hello Really Stupid and a beginner here, So i have a script for recording High scores. But i kinda want to do something different for it.

I have the functions for it in a single script. But i want it to split up into two different UI. First one was of course the in-game one (which will display the current score) That one i already got fixed up.

And the one for the game-over screen (High score in the Game Over UI) My problem starts here because the Game over screen i have is deactivated at the Start. So that when the Player Dies, The Screen is just going to get enabled, which will execute the Animations and the Sound for it. The thing is i want it to be with that game over screen. If that makes sense. But i can’t put it in there because it is disabled at first. Which will make the script for it disabled thus not getting the current Score. I was wondering if is there a way to make this work without remaking the game over screen and changing it to a new different script. Like maybe running the high score screen in the background hidden but mirroring the score to the text that appears when the Game over screen pops out. I don’t know lmao. But maybe something similar or another solution that can work is possible?


public class ScoreManager : MonoBehaviour

// pardon the the stupid code

public static ScoreManager instance;

public TMP_Text scoreText;
public TMP_Text highscoreText;

int score = 0;
int highscore = 0;

private void Awake()
    instance = this;

// Start is called before the first frame update
void Start()
    highscore = PlayerPrefs.GetInt("highscore", 0);
    scoreText.text = score.ToString();
    highscoreText.text = "HIGHSCORE:" + highscore.ToString();

// Update is called once per frame
public void AddPoint()
    score += 50;
    scoreText.text = score.ToString();
    if (highscore < score)
    PlayerPrefs.SetInt("highscore", score);

public void HighScoreReset()
    highscoreText.text = "0";

    // Down here was just for future use idk
    //PlayerPrefs.DeleteAll(); //delete everything from username, etc


I do this by having the score kept in a Singleton that exists on the Game and Game Over screens. You also need that if you have multiple levels.