- Home /
Quality-Settings Selections in scripting
Hello Guys and Gurls.
I have been working all day on my menu at the start of the game (MainMenu). I have seem to run in a problem however. It is not that I do not have the knowledge to code it myself or time. It is that I do not have the sweetest clue on how to do it without using a different script for all of the inputs.
Anyway, I have got an options GUI set out, not the kind of GUI SCRIPTING, but the 3D text and then click scripting. Now when I click options all is fine, it opens a menu that has all the quality settings on there, the colour rollover works aswell. ALL IS WORKING!
However, my problem occurs now. How do I get it so that when I click an 3DText like "Options_Fantastic" It actually changes it?
Please help, all answers that are reliable get thumbs-up.
Answer by Coderdood · Jun 08, 2013 at 05:46 PM
The Quality Settings class is the one you want. In particular there is the SetQualityLevel method. The SetQualityLevel page has a good example of how it is used.
Note that as stated in the documentation:
When building a player quality levels that are not used for that platform are stripped. You should not expect a given quality setting to be at a given index. It's best to query the available quality settings and use the returned index.
So you will need to use QualitySettings.Names first to get the available settings and then use SetQualityLevel to set it to the desired setting. This is documented on the page linked but I had reread it myself to understand so I thought it would be better to point it out.
Thanks, just to point out. WILL I need to use QualitySettings.Names if I know the available settinga already?
Its probably a good idea - that way you know for sure that your code will work 100% of the time even if platform or your build changes. Also the documentation states:
"You should not expect a given quality setting to be at a given index"
So I would not expect there to be any 100% reliable way of deter$$anonymous$$ing the value to pass to SetQualityLevel without using Names.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
How to get back to the main menu when dead? 1 Answer
Main Menu Problem 0 Answers
How could I have a ball chooser menu? 1 Answer
pause menu on android phone 1 Answer