Quantcast
Channel: Answers by "Artifactx"
Viewing all articles
Browse latest Browse all 14

Answer by Artifactx

$
0
0
There are many ways you can do this, one is using PlayerPrefs. You can make a method like thi to store your highscore: public void SaveData() { PlayerPrefs.SetInt("Player Score", player.Score); } And then use a method like this to load the score back in public void LoadData() { player.Score = PlayerPrefs.GetInt("Player Score", 0); } Thats how you can save and load a score. About saving multiple score you could make an array that holds the top 10 score and save all these by using PlayerPrefs. And load them out to the array when you run your LoadData() Thats one way of doing it. You could also save the data in a database, an xml file or even a txt file. I just find using PlayerPrefs easier.

Viewing all articles
Browse latest Browse all 14

Trending Articles