Customize the window
Set titles and order
Each settings class shows as a section titled after its class name: AudioDefaults becomes "Audio
Defaults". Add [SettingsDisplay] to choose the title, add a tooltip, or change the order. Lower
Order values come first.
[SettingsDisplay("Audio", Tooltip = "Master mix defaults.", Order = 0)]
public sealed class AudioDefaults : BuildSettingsEntry<GamePage> { /* ... */ }
[SettingsDisplay] works on pages too, to rename or reorder them in the left-hand list.Revert a section
When a section's values differ from their defaults, a grey bar appears along its left edge. To go back to the defaults, right-click the section header and select Revert to Default.
Draw a section yourself
Sections draw their fields one per line, like the Inspector. For another layout, write a regular
PropertyDrawer for your settings class. Settings Kit uses it automatically.
[CustomPropertyDrawer(typeof(NetworkConfig))]
public sealed class NetworkConfigDrawer : PropertyDrawer
{
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
=> EditorGUIUtility.singleLineHeight;
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
SerializedProperty host = property.FindPropertyRelative("host");
SerializedProperty port = property.FindPropertyRelative("port");
// ... draw host and port on one line ...
}
}
Validate values
Implement IValidatedSettings and return false with a message when a value is wrong:
[System.Serializable]
public sealed class NetworkConfig : BuildSettingsEntry<GamePage>, IValidatedSettings
{
[SerializeField] int port = 7777;
public bool Validate(out string error)
{
if (port < 1024 || port > 65535)
{
error = $"Port must be between 1024 and 65535 (was {port}).";
return false;
}
error = null;
return true;
}
}
The message appears under the section: as an error for build settings, and as a warning for editor and user settings.