Skip to main content

Class SessionInstance

Singleton that holds the current session's SessionInfo for the lifetime of the application, accessible from any scene without a scene reference.

public sealed class SessionInstance

Inheritance​

Remarks​

Session data (participant ID, scene graph name, level index) is retrieved once at startup by SessionInfoFetcher and then stored here so every system that needs it can call SessionInstance.Instance.Info without requiring a dependency on the fetcher or any particular scene object.

The static readonly field initialises the instance at class-load time (before any RuntimeInitializeOnLoad code runs), ensuring the singleton is never null and avoiding the double-checked locking overhead of lazy initialization.

Fields​

Info​

The session metadata for the current run, written once at startup by SessionInfoFetcher and read throughout the session.

public SessionInfo Info

Field Value​

SessionInfo

Remarks​

Exposed as a public field (rather than a get-only property) so the fetcher can populate it by assigning a fully constructed SessionInfo object in a single statement. All subsequent reads treat it as effectively immutable.

Properties​

Instance​

Gets the application-wide session instance.

public static SessionInstance Instance { get; }

Property Value​

SessionInstance