- Home /
PlayerPrefs.DeleteAll() changes resolution setting? Looks like a unity bug
Hello everyone!
I am testing my game, and added PlayerPrefs.DeleteAll() in the Awake function, just to remove all saved data, for testing purposes.. For example I will test if levels are getting unlocked if previous level is completed and so on.. As I open the build, I see resolution blurry, in every scene I didn't get the resolution I had. Resolution I mean GUITexture (fullscreen background Image) and every other GUITexture I am using. I tried to build it again and again, and still I am getting this blurry resolution.
As I concluded, PlayerPrefs had saved the resolution settings or import settings of textures, and with PlayerPrefs.DeleteAll(), they are gone/deleted.. But it has nothing to do with that, it is strage and as I concluded it is a unity bug.
Has someone experienced this before?
Answer by ahaykal · Jul 30, 2013 at 07:19 AM
Well it happened to me once, and the way I fixed it is like this:
Go to player settings --> Resolution and Presentation --> Display Resolution Dialog.
Enable it then build then disable it. That should fix it.
Hope that helps
well just tried and the second build returned to the resolution I had.. Looks strange though, but it solved !! thanks
Answer by Sylafrs · Apr 30, 2014 at 03:08 PM
The idea is that the resolution is set within our PlayerPrefs then used later. You can also force the resolution you want with Screen.SetResolution.
Player Pref's resolution (last used resolution) is stronger than the Player Settings resolution (that would be the first used resolution, if you don't use the dialog)
Answer by Bunny83 · Jul 29, 2013 at 03:45 PM
Uhm, PlayerPrefs are ment to save and load Preferences for the Player. The resolution setting is also a preference.
well how to return the resolution I had? I am rebuilding and getting still blurry.. I mean I can't know how to return it back to how it was
The only thing i know which Unity does save is the graphics quality setting. It's called "UnityGraphicsQuality". It's an int which holds the quality level the game used last time.
thank you for your useful information! ahaykal's answer solved the thing..
Your answer
Follow this Question
Related Questions
Poor Untiy 2D Sprite Quality/Crispness 1 Answer
Resolution is not saving. 2 Answers
Ingame Quality Settings not recognized 1 Answer
PlayerPrefs.DeleteAll() not working in Editor 1 Answer
PlayerPrefs Bug 0 Answers