How would I add a persistent high score?
Solution 1:
PlayerPrefs helps you to store game data.
Usage:
void SaveHighScore(float value)
{
PlayerPrefs.SetFloat("HighScore", value);
}
void LoadHighScroe()
{
float hs = PlayerPrefs.GetFloat("HighScore", 0.0f); // 0.0f here is default value when key/value not exest in PlayerPrefs
ScoreText.text = hs.ToString();
}