- Home /
adjust video settings in game
in the menu of my game I created the video settings where you can change the anti-aliasing filter, anistropic, vsync, etc.. but my question is this: if you change the video settings in the menu, once the game is closed and reopened the settings have been saved, or you have to re-edit again from the menu options?
Do you write out the changes to PlayerPreferences or anything of that sort?
eh ... actually no .. I do not know to use the playerprefabs help me? :)
Answer by Gjallanhorn · Sep 03, 2013 at 12:43 AM
If you're using "PlayerPrefs" and vars are assign with them, you don't need to re-edit.
If you're not using "PlayerPrefs", settings won't be saved, so use it! hehe...
I understand, and which script should I use? I never used the PlayerPrefs
Probably you're using vars to save the values of your settings, so you just set a PlayerPref with them, something like:
PlayerPrefs.SetFloat("fieldOfView", varFieldOfView);
Then you get this values on Start method:
float varFieldOfView;
void Start(){
varFieldOfView = PlayerPrefs.GetFloat("fieldOfView");
}
Now, just use this vars on your settings.
[http://docs.unity3d.com/Documentation/ScriptReference/PlayerPrefs.html][1] [1]: http://docs.unity3d.com/Documentation/ScriptReference/PlayerPrefs.html
Read the reference to more info.
Your answer
Follow this Question
Related Questions
how to save the resolutions for the options menu 1 Answer
Using PlayerPrefs to save settings menu 2 Answers
Start with settings from updater 0 Answers
Menu and Difficulty setup 0 Answers