ParagonSettingsProvider
Internal SettingsProvider that renders ParagonSetting entries in Unity's Preferences or Project Settings window. Iterates over a list of settings and draws each one using the appropriate Unity editor control based on its value type.
Definition
Namespace: Paragon.Editor Assembly: Paragon.Editor.dll
internal class ParagonSettingsProvider : SettingsProviderInheritance: SettingsProvider → ParagonSettingsProvider
Remarks
Created by ParagonSettings via Unity's [SettingsProvider] factory pattern. Two instances may exist simultaneously — one for project settings (SettingsScope.Project) and one for editor preferences (SettingsScope.User).
Settings Paths
SettingsScope.Project
Project/{Application.productName}
Edit → Project Settings
SettingsScope.User
Preferences/Paragon
Edit → Preferences
Type Dispatch
The DrawSetting method uses a switch on the setting value to select the appropriate editor control:
float
SettingsGUILayout.SearchableFloatField
int
SettingsGUILayout.SearchableIntField
bool
SettingsGUILayout.SearchableToggle
string
SettingsGUILayout.SearchableTextField
Color
SettingsGUILayout.SearchableColorField
Gradient
EditorGUILayout.GradientField
Vector2
EditorGUILayout.Vector2Field
Vector3
EditorGUILayout.Vector3Field
Vector4
EditorGUILayout.Vector4Field
Enum ([Flags])
EditorGUILayout.EnumFlagsField
Enum (standard)
EditorGUILayout.EnumPopup
UnityEngine.Object
EditorGUILayout.ObjectField
Other
Label with ToString() (read-only)
The Searchable* variants from SettingsGUILayout support Unity's settings search bar — typing in the search box highlights matching settings. Gradient and Vector types use standard EditorGUILayout fields which don't support search highlighting.
Fields
settings
List<ParagonSetting>
private readonly
The settings to render in this provider
Constructors
settingsScope
SettingsScope
Project or User — determines the path via GetSettingsPath()
settings
List<ParagonSetting>
The settings to render
Methods
OnGUI
Renders all settings. Sets label width to 300px via GUIHelper.PushLabelWidth(), draws each setting inside a VerticalLayout with SettingsAreaStyle, and auto-saves on change.
Change detection: Each setting is wrapped in EditorGUI.BeginChangeCheck()/EndChangeCheck(). On change:
Updates the static property via
setting.SetValue()Persists via
ParagonSettings.Set()Saves to disk via
ParagonSettings.Save()
Common Pitfalls
Unsupported types render as read-only labels. If a setting's type doesn't match any case in DrawSetting, it falls through to the default which displays ToString() as a non-editable label and returns null. This can cause the static property to be set to null on interaction.
See Also
ParagonSettings — creates this provider via
[SettingsProvider]ParagonSetting — the setting entries this provider renders
ParagonSettingAttribute — attributes that mark discoverable settings
DrawGUI —
DrawGUI.Style.SettingsAreaStyleused for layoutParagonSettings Overview — system overview
Last updated