Alright, right now I save my highscores between 1-9 in my PlayerPrefabs.
I get them like this:
private SortedList<string, int> GetHighScores()
{
SortedList<string, int> tempList = new SortedList<string, int>();
for (int i = 1; i < 10; i++)
{
string tempName = "Highscore " + i;
tempList.Add(tempName, PlayerPrefs.GetInt(tempName));
}
return tempList;
}
but I would also like to display them in a good way, I guess I could make 1 text object for each highscore. But that seems pretty bad IMO. So what I’ve done so far is this:
void OnGUI()
{
if (_showHighscore)
{
SortedList<string, int> highScoreList = GetHighScores();
foreach (var score in highScoreList)
{
GUI.Label(new Rect(20, 20, 100, 500),"
" + score.Key + score.Value);
}
}
}
How ever, doing it like that will just make it so all scores overlap.