This is a question I knew I’d eventually get to, and it’s a little deeper than it initially seems.
I can open my app and play as many games as I want and the highest score will be saved (I’ve attached the script if anybody would like to use it). But when I close the app permanently and re-open, the game does not display the high score I previously got. I understand why this is happening.
void Start () {
if (highscore < 1){
highscore = 0;
}
}
void Update () {
if (score > highscore)
{
highscore = score;
}
}
My question is, how can I allocate a space on the phone to save that highscore permanently, whether the app is running or not - and to reload that highscore when the application is started.
Building upon that, if I create a system in my game where the game points can be used to purchase items, how could I save the variables that go along with that? If I want to eventually update my game once it’s on the store, I want those purchases to remain and the previous score/highscore to be there.
Thank you for the help.