Interfaces

IResettable

Contract representing components that implement resettable field options to be collected and managed by the AplosSettingsManager.

Namespace: AplosConsole.Settings

Public methods

ResetToDefaults

Example

public class MyResettableComponent : MonoBehaviour, IResettable
{
    public void ResetToDefaults()
    {
        // restore authored defaults
    }
}

Description: Discards persisted state and restores authored defaults, on disk and live.


ISettingsApplicable

Generalised apply-hook contract for pushing loaded field values into live runtime state.

Namespace: AplosConsole.Settings

Public methods

ApplySettings

Example

public void ApplySettings()
{
    // push loaded field values into live runtime state
}

Description: Pushes the currently-loaded field values into live runtime state. Colour state is handled separately via IColorSettingsApplicable.


ISettingsService

Lets components react to settings being (re)loaded and apply the saved palette to a spawned object. Implemented by AplosSettingsManager.

Namespace: AplosConsole.Settings

Properties

Name Data Type Description
HasLoadedSettings bool True once a saved configuration has been loaded and pushed to visuals. Read-only.
SettingsLoaded UnityEvent Raised after each load so consumers can (re)apply without ordering assumptions. Read-only.

Public methods

ApplySettingsTo

Parameters:

  • root (GameObject) — The freshly spawned object to apply the saved settings to.
  • includeChildren (bool) — Whether to include inactive children when applying settings. Defaults to true.

Example

settingsService.ApplySettingsTo(newWindow.gameObject);

Description: Applies the persisted settings to a freshly spawned object (e.g. a runtime window).


ISettingsStore

Internal contract. Persists and restores the raw settings-configuration JSON, abstracting the backing store (file, prefs, ...) from the settings manager that serializes and applies it.

Namespace: AplosConsole.Settings.Persistence

Public methods

TryLoad

Parameters:

  • json (out string) — The stored JSON, if a saved configuration exists and could be read.

Example

if (settingsStore.TryLoad(out string json))
{
    // apply json
}

Description: Returns the stored JSON when a saved configuration exists and could be read; returns false (with the defaults left in place) otherwise.


Save

Parameters:

  • json (string) — The settings JSON to persist.

Example

settingsStore.Save(json);

Description: Persists the given JSON to the backing store.