How to display text from a text object to another text object?

hi guys,

i made a 2d game and on the right side of the screen the score and highscore are displayed.I did this with first making a canvas and in the canvas, I made a text object. In the canvas I also made an object called ‘gameover’. In this object i made a gameover screen with a panel. (This works)

the actual problem is I made a text object in my gameover object and i want the score and highscore to be displayed in that text object. So when the gameover screen comes the same scores are displayed.

How can i do that in a easy way?

int TheHighscore; //this would be your highscore int

void OnGUI(){	
    	int XPos = 10;
    	int YPos = 10;
    	int TextboxSizeX = 100;
    	int TextboxSizeY = 20;
    
    	GUI.Label(new Rect(XPos, YPos, TextboxSizeX, TextboxSizeY), TheHighscore.ToString());
 }

GUI.Label