Table of Contents

Class

The CoreFrameworkPreferencesProvider class is a SettingsProvider responsible for displaying and managing Core Framework preferences in the Unity Editor. It allows users to toggle debugging logs and adjust log message font sizes for informational, warning, and error logs.

public class CoreFrameworkPreferencesProvider : SettingsProvider
Inheritance
object
Extension Methods

Constructors

CoreFrameworkPreferencesProvider(string, SettingsScope, IEnumerable<string>)

Creates an instance of the CoreFrameworkPreferencesProvider.

private CoreFrameworkPreferencesProvider(string path, SettingsScope scopes = SettingsScope.User, IEnumerable<string> keywords = null)

Parameters

path string

The path of the settings provider, e.g., “Preferences/Core Framework/Settings”.

scopes SettingsScope

The scope of the settings provider (default is SettingsScope.User).

keywords IEnumerable<string>

Keywords associated with the settings provider.

Fields

KSettingsPath

The path of the settings provider in the Preferences window.

private const string KSettingsPath = "Preferences/Core Framework/Settings"

Field Value

string

Methods

CreateCoreFrameworkPreferencesProvider()

Creates an instance of the $CLASS and registers it with the [SettingsProvider] attribute.

[SettingsProvider]
public static SettingsProvider CreateCoreFrameworkPreferencesProvider()

Returns

SettingsProvider

The created CoreFrameworkPreferencesProvider instance.

OnActivate(string, VisualElement)

Use this function to implement a handler for when the user clicks on the Settings in the Settings window. You can fetch a settings Asset or set up UIElements UI from this function.

public override void OnActivate(string searchContext, VisualElement rootElement)

Parameters

searchContext string

Search context in the search box on the Settings window.

rootElement VisualElement

Root of the UIElements tree. If you add to this root, the SettingsProvider uses UIElements instead of calling SettingsProvider.OnGUI to build the UI. If you do not add to this VisualElement, then you must use the IMGUI to build the UI.

OnGUI(string)

Use this function to draw the UI based on IMGUI. This assumes you haven't added any children to the rootElement passed to the OnActivate function.

public override void OnGUI(string searchContext)

Parameters

searchContext string

Search context for the Settings window. Used to show or hide relevant properties.

ProjectSettingsMenuItem()

Opens the Preferences window at the specified path when the menu item is selected.

[MenuItem("Core Framework/Preference Settings", priority = 1)]
private static void ProjectSettingsMenuItem()