- Home /
Some quality settings not saving when altered in-game
So I've set up an in-game graphics options menu for my game, but the Anisotropic and texture quality settings aren't being saved.
If the default is QualitySettings.masterTextureLimit=0 and QualitySettings.anisotropicFiltering=AnisotropicFilter.ForceEnable, and then I run this code:
QualitySettings.masterTextureLimit=1;
QualitySettings.anisotropicFiltering=AnisotropicFiltering.Disable;
Application.LoadLevel(Application.loadedLevelName);
...The settings are back to the defaults after reloading the level (checked by debug messages). To make it even stranger, altering QualitySettings.antiAliasing works just fine. Note that to test this, I always build out to the stand alone. So what's going on here?
Try configuring the shadows(enable/disable, resolution), its not really possible, I have been trying to write an in game graphics options menu as well and it has proven to be painful.
To bump, and update this request, with the default settings at Per Texture (Enabled), this code:
if (GUI.Button(FitToScreen(window.x$$anonymous$$in+5, window.y$$anonymous$$in + 140, window.width, 30), "Anisotropic Filtering: "+QualitySettings.anisotropicFiltering.ToString())) {
Debug.Log("Anisotropic Filtering is "+QualitySettings.anisotropicFiltering.ToString());
switch (QualitySettings.anisotropicFiltering) {
case AnisotropicFiltering.Disable:
Debug.Log("Enabling");
QualitySettings.anisotropicFiltering = AnisotropicFiltering.Enable;
break;
case AnisotropicFiltering.Enable:
Debug.Log("Forcing On");
QualitySettings.anisotropicFiltering = AnisotropicFiltering.ForceEnable;
break;
case AnisotropicFiltering.ForceEnable:
Debug.Log("Disabling");
QualitySettings.anisotropicFiltering = AnisotropicFiltering.Disable;
break;
default:
break;
}
}
Upon drawing the button, Anisotropic Filtering immediately reverts to Disabled. This was checked in the QualitySettings live. Pressing the button prints that it is disabled, and that it is enabling. Doing an if-conditional check, I verified that it does become enabled, but by the next cycle, it has reverted back to Disabled. Help is appreciated.