Skip to main content

GlobalSettings<T>

A class in Alta.Global.Runtime, Alta.Global.

Base for global settings ScriptableObjects with a static Instance. The instance is set when a GlobalSettingsInitializer or the lifetime-scope installer calls InitializeInstance at startup.

Constructors​

MemberWhat it is
GlobalSettings()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

2 private and internal fields
MemberWhat it is
private static T instanceThe settings asset, set by InitializeInstance.
private static int startedCountUnused.

Properties​

MemberWhat it is
static T Instance { get; }The active settings asset. Null until it has been initialized (the editor fallback returns null in this build).

Methods​

MemberWhat it is
sealed override void InitializeInstance()Makes this asset the static Instance. Called at startup for every listed settings asset.
1 private and internal method
MemberWhat it is
private static T GetEditorInstance()Returns null in this build; Instance stays null until the asset is initialized.