Class ScriptableObjectSettingsProvider
A helper class for displaying ScriptableObject-based settings in the Unity Editor using the SettingsProvider interface.
public class ScriptableObjectSettingsProvider : SettingsProvider
Inheritance
Constructors
ScriptableObjectSettingsProvider(ScriptableObject, SettingsScope, string)
Initializes a new instance of the ScriptableObjectSettingsProvider class.
public ScriptableObjectSettingsProvider(ScriptableObject settings, SettingsScope scope, string displayPath)
Parameters
| Name | Type | Description |
|---|---|---|
settings | ScriptableObject | The ScriptableObject settings instance to display. |
scope | SettingsScope | The scope of the settings (User or Project). |
displayPath | string | The display path for the settings in the Unity Settings window. |
Fields
Properties
serializedSettings
The serialized object for the settings instance.
public SerializedObject serializedSettings { get; }
Property Value
Methods
HasSearchInterest(string)
Builds the set of search keywords based on the serialized object.
public override bool HasSearchInterest(string searchContext)
Parameters
| Name | Type | Description |
|---|---|---|
searchContext | string | The search context string. |
Returns
bool — True if there are search keywords, otherwise false.
OnActivate(string, VisualElement)
Called when the settings are displayed in the UI.
public override void OnActivate(string searchContext, VisualElement rootElement)
Parameters
| Name | Type | Description |
|---|---|---|
searchContext | string | The search context string for filtering the settings. |
rootElement | VisualElement | The root UI element to attach the settings UI to. |
OnDeactivate()
Called when the settings are no longer displayed in the UI.
public override void OnDeactivate()