One more thing that would be good to have in our game is tracking the player's high score. For this, we not only need to keep the high score of the current session, but then persist that data so it's preserved for the next time you play.
First, we'll make a UI element to display the current high score. It will be easiest to simply duplicate the ScorePanel we just made and modify it:
- Select the ScorePanel in Hierarchy and duplicate it (right-click and select the option Duplicate).
- Rename it HighScorePanel.
- Set the Rect Transform to Left: -120, Top: 50, Right: 120, Bottom: -50.
- Rename child ScoreTitle to HighScoreTitle.
- Change its Text to High Score.
- Rename child ScoreValue to HighScoreValue.
- Set Font Style to Bold and Italic, and Color to a pale orange (#FF9970FF).
The current high score will be kept in an ordinary C# object class named PlayerProgress...