- Home /
The question is answered, right answer was accepted
performance wise, which is better..Playerprefs or global floats
hi huys, im working on scores for each of my levels and im just wondering which is better performance wise.
i need to store different score limits for each level and not sure the most efficient way to go about it
Answer by GameVortex · Nov 14, 2013 at 07:02 PM
Global floats is better performance wise, but PlayerPrefs can store your scores between playsessions. So it all depends on if you want the scores to be saved for next time or reset.
Answer by Julian-Glenn · Nov 14, 2013 at 07:15 PM
If you want the scores to persists through levels or full closures of the app, PlayerPrefs is the way to go. It honestly utilizes minimal resources (iOS/Android/PS/Xbox/etc) PlayerPrefs is a quick write to a text file (or flat file database) - like i said negligible given today's hardware. Depending on how much info you want to save and your familiarity with SQL you could use SQLite - a simple .NET .dll you add you your Assets/Plugins folder and then you have a full database at your disposal.
:-) /julian
Answer by lemiwinks · Nov 14, 2013 at 07:27 PM
well i will have playerprefs for the score as i need to look back at it after re openeing the game. but the ones in question will be onlu used for reading, never written to. as the hold the score's Target, which will be used as a reference in order to calculate how many stars to give to a player. e.g if players scores 10 in level 1, and the target for that level is 20, the player will only get 50% marked on screen.
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
How To Add PlayerPrefs Scores? 1 Answer
PlayerPrefs are global? 3 Answers
Converting from an Int to a Float and back with PlayerPrefs 1 Answer