- Home /
How do I programmatically select Input, Quality, etc. settings?
I'm writing an editor extension and I'd like to programmatically select various settings objects. I see that they each have their own custom editors:
[CustomEditor (typeof(QualitySettings))]
internal class QualitySettingsEditor : Editor
But I don't see where the objects themselves are kept, unlike the lightmap settings:
Selection.activeObject = LightmapEditorSettings.GetLightmapSettings();
Answer by rutter · Jun 04, 2014 at 05:42 AM
Take a look at the QualitySettings script manual page. You'll especially want to check the static GetQualityLevel, SetQualityLevel, IncreaseLevel and DecreaseLevel functions.
Thanks for taking the time to answer. This gets me individual setting properties but not the original settings object that the static functions affect. If I could get an instance of the QualitySettings object, I could use Selection.activeObject = qualitySettings
to select it.
As far as I can tell there is no such object accessible to scripting. It appears to only be exposed to the editor via SerializedObject/SerializedProperty, and is no doubt serialized in a form used by the C++ engine but not accessible from C#. $$anonymous$$y. You could write your own settings class that sets values into the static properties of the QualitySettings class.
Your answer
Follow this Question
Related Questions
Initialising List array for use in a custom Editor 1 Answer
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Opening TXT files in Notepad instead of Monodevelop 0 Answers
Script Editors for Unity 3 Answers