Customization
Customizing Settings
Section titled “Customizing Settings”The [ProjectSettings] attribute accepts optional parameters for controlling how your settings are stored and displayed in Unity.
[ProjectSettings( fileName: "Example.asset", fileDirectory: "OneLastClick", settingsProviderName: "Example Settings", settingsProviderDirectory: "OneLastClick/Gameplay")]public class ExampleProjectSettings : ScriptableObject{}Attribute Parameters
Section titled “Attribute Parameters”| Parameter | Description |
|---|---|
fileName |
Changes the name of the settings file stored in ProjectSettings. |
fileDirectory |
Stores the settings file in a subdirectory within ProjectSettings. |
settingsProviderName |
Changes the name displayed in the Project Settings window. |
settingsProviderDirectory |
Places the settings page inside a nested Project Settings category. |
editorOnly |
Prevents the settings from being included in runtime builds. |
Project Settings Location
Section titled “Project Settings Location”Use settingsProviderDirectory to organize settings into categories.
[ProjectSettings( settingsProviderDirectory: "OneLastClick/Rendering", settingsProviderName: "Lighting Settings")]public class LightingProjectSettings : ScriptableObject{ public Material DefaultMaterial;}This creates the following entry:
Project Settings → OneLastClick → Rendering → Lighting Settings
File Location
Section titled “File Location”Use fileDirectory to organize the serialized settings files within the project’s ProjectSettings folder.
[ProjectSettings( fileDirectory: "OneLastClick/Rendering", fileName: "Lighting.asset")]public class LightingProjectSettings : ScriptableObject{}The settings are stored at:
ProjectSettings/└── OneLastClick/ └── Rendering/ └── Lighting.assetEditor-Only Settings
Section titled “Editor-Only Settings”Set editorOnly to true when a setting is only required by editor tooling.
[ProjectSettings(editorOnly: true)]public class BuildProjectSettings : ScriptableObject{ public string BuildOutputDirectory; public bool EnableDevelopmentBuild;}Editor-only settings remain available in Project Settings and through ProjectSettingsEditorDatabase, but are excluded from runtime builds.