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 : SettingsProvider

Inheritance: 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

Scope
Path
Where it appears

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:

Value Type
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)

circle-info

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

Field
Type
Access
Description

settings

List<ParagonSetting>

private readonly

The settings to render in this provider

Constructors

Parameter
Type
Description

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:

  1. Updates the static property via setting.SetValue()

  2. Persists via ParagonSettings.Set()

  3. Saves to disk via ParagonSettings.Save()

Common Pitfalls

circle-exclamation

See Also

Last updated