- Home /
Calling PlayerPrefs.GetInt/GetFloat every update bad for performance?
Just curious, is using PlayerPrefs once per update frowned upon? I'm currently using it to synchronize values between classes (i.e. PlayerPrefs.GetInt("Health")). If it's bad for performance I can switch to something else like a signleton or just a static int value instead. I use playerprefs a lot for many different things and now I'm starting to think that maybe it would be hurting performance and not the best thing to use for what I want..
Using PlayerPrefs for something else than saving and restoring value between sessions sounds wrong to me. I'd avoid it and stick to singleton/static variables, cache the manager script or anything else, really.
Answer by DaveA · Apr 07, 2012 at 07:24 AM
You'd be hitting the disk like 100 times/second for no good reason. Your other options are better.
Your answer
Follow this Question
Related Questions
PlayerPrefs and Multiplayer 0 Answers
Errors and suggestions 2 Answers
I am having trouble getting a web build to save out an .upp file from my code 0 Answers
Check the size of PlayerPrefs from web player 2 Answers
PlayerPrefs save after quit? 2 Answers