0
\$\begingroup\$

In other words, how can I load the progress for a game? I only want to store a score and load it again when the game starts (ex. if I get the 100 score and close the game, when I come back, I want to continue my progress from the 100 score)

\$\endgroup\$
0

1 Answer 1

1
\$\begingroup\$

You're looking for PlayerPrefs. Take a gander at the documentation.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ The usual caution here is that PlayerPrefs is trivial for users to edit, so make sure you don't trust the data found in this file for things like public leaderboards or awarding trophies / DLC / other entitlements. If your case is pure single-player it may not be important, but it can be demoralizing for players who worked hard for those perks to see peers get them through simple hacking. (It's arguably impossible to completely secure a web game, but you do have choices for how many speed bumps you want to put in a hacker's way) \$\endgroup\$ Commented Jan 29, 2016 at 20:59
  • \$\begingroup\$ Thanks for that @DMGregory . Yes PlayerPrefs is for anything you don't care if the player goes and changes it however they please. Local highscore display? Psh, if they want to hack that no one cares. For more complex save stuff, you still have to assume that the player will find a way to rewrite the file. \$\endgroup\$ Commented Jan 29, 2016 at 21:03

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.