Hi,
i wrote a script for changing quality settings ingame, working fine.
Now i would like to save this settings in the with the playerprefs.
Saving an int in the player prefs, for example for the anti alising settings wirking fine, too.
I even can get this int back on starting the game.
But if i take this int and say in my script hey use the new value for the anti alising settings it just doesn’t.
I can see the value in the settings is changed but the anti alising in the game is at 0.
Here is how i do this:
Start the game, change the settings, click on safe, then the script saves the playerprefs.
(I can see the value changed in the registry).
I restart the game:
void start function checks the value and sets it to the new value.
In the settings i now see AA is 8x and nof “off” as at the first start.
It seems my script does not apply the nwe AA value to the Quality settings…
Anyone has some idea why?
Maybe a lil bit code here.
// These are the variables for setting and displaying the AA
// currentAA will be saved in the playerprefs later
private int[] setAntiAlising = {0, 2, 4, 8};
private string[] displayAntiAlisingSetting = {"Off", "2x", "4x", "8x"};
private int currentAA = 0;
// Saving the settings
if( GUILayout.Button( "Save", settingsButtonStyle ) ) {
PlayerPrefs.SetInt( "currentAA", currentAA );
}
// load the settings
void Start() {
if( PlayerPrefs.GetInt( "currentAA" ) > 0 ) {
currentAA = PlayerPrefs.GetInt( "currentAA" );
/**
* set AntiAlising to current AntiAlising status
*/
QualitySettings.antiAliasing = setAntiAlising[currentAA];
Debug.Log( QualitySettings.antiAliasing );
}
else {
currentAA = 0;
}
}
Hope u understand my problem, if not ill do some pics.