- Home /
Retaining variables after closing app
I have been working on an iOS app where a player's total collectables are kept track of for the entirety of thee ownership of he app. I can keep track of the totals perfectly fine in game and even when play sessions are suspended(the i-device's home button is hit) however if the app is then closed manually (by which i mean the player double taps the home button on the i-device and then closes the app from the multitask bar), then the totals reset to 0. How can i keep track of variables even after the app has closed. I have read that player preferences can be used for this but not for iOS applications. I read that i would need to write my own player preference code but that same article made it out to be quite an advanced task. I'm not an expert programmer by any means so I'm not sure if that is within my capabilities. If there is an moderately easy way around this issue, please point me in the right direction because I am at a loss. Thank you for any help you can provide.
Answer by Eric5h5 · Aug 08, 2012 at 11:32 PM
Use PlayerPrefs. No, you don't need to write your own code for this.
Your answer
Follow this Question
Related Questions
How to access variables between scripts in unity JavaScript? 3 Answers
When I try to increment a variable by 1, why does it add 10? 1 Answer
Best way to handle a lot of variables 3 Answers
Can I have a private Variable "look" in folder? 1 Answer
Passing a set of variables from one script to another 3 Answers