Declare a page

Inherit SettingsPage once per page. It appears in Project Settings, in Preferences, or in both, depending on the kinds of settings it holds.

public sealed class GamePage : SettingsPage
{
    public override string Path => "My Game";
    public override string Description => "Runtime tunables.";
    public override string HelpUrl => "https://docs.example.com";
}
PropertyDescription
PathWhere the page appears in the list. Use / to nest it, for example "My Game/Networking". Required.
DescriptionA short text at the top of the page. Optional.
HelpUrlAdds a "?" button that opens this link. Optional.
Warning: Keep Path constant. It is read once per editor session, so a path that changes during a session doesn't move the page until Unity restarts.
Note: Pages are identified by their class, not their title, so two packages that both name their page "Settings" still get separate pages.

Write a settings class

A settings class holds the values of one section on a page. To write one:

  • Inherit one of the four base classes, with your page as the type argument.
  • Mark it [System.Serializable].
  • Give it a parameterless constructor (the default one is fine).
  • Store its values in [SerializeField] fields.
[System.Serializable]
public sealed class AudioDefaults : BuildSettingsEntry<GamePage>
{
    [SerializeField, Range(0f, 1f)] float masterVolume = 0.8f;
    public float MasterVolume => masterVolume;
}

Each field's initializer sets its default value: the value a new project starts with, and the value Revert to Default restores. A field can also reference a project asset, such as a texture or a ScriptableObject; in a build setting, the asset is included in the build along with it.

Choose a kind of setting

The base class decides where a setting appears and whether it reaches your builds:

Base classWindowShared with the teamIn buildsUse it for
BuildSettingsEntry<TPage>Project SettingsYesYesValues your game or package reads at runtime.
PlatformSettingsEntry<TPage>Project SettingsYesYes, per platformValues that differ per platform, like a server URL.
EditorSettingsEntry<TPage>Project SettingsYesNoOptions for your editor tools.
UserSettingsEntry<TPage>PreferencesNoNoPersonal options, like a highlight color.
Note: Project settings are saved in ProjectSettings/SettingsKit.asset and user settings in UserSettings/SettingsKit.asset. With Unity's standard .gitignore, the first is shared with your team and the second stays on each machine, with nothing to set up.
Warning: In a build, reading an editor or user setting returns its default values, not the ones set in the editor.

A per-platform setting gets a row of tabs in its section. Default holds the values every platform uses; select + to give a platform its own values, and - to remove them. A read returns the values for the platform the game runs on, which in the editor is the active build target.

A per-platform section with its tabs