Right now I have working high scores in my game, but if a new high score is set, it just replaces the one that was there and doesn’t move the others down the list. How would I make it so that when a high score is set it just pushes the others down and removes the lowest one? Here’s the code I’m using now:
if (PlayerPrefs.GetFloat ("Highscore1") < scoreNumber)
PlayerPrefs.SetFloat ("Highscore1", scoreNumber);
else if (PlayerPrefs.GetFloat ("Highscore2") < scoreNumber)
PlayerPrefs.SetFloat ("Highscore2", scoreNumber);
else if (PlayerPrefs.GetFloat ("Highscore3") < scoreNumber)
PlayerPrefs.SetFloat ("Highscore3", scoreNumber);
else if (PlayerPrefs.GetFloat ("Highscore4") < scoreNumber)
PlayerPrefs.SetFloat ("Highscore4", scoreNumber);
else if (PlayerPrefs.GetFloat ("Highscore5") < scoreNumber)
PlayerPrefs.SetFloat ("Highscore5", scoreNumber);