Skip to main content

ProjectLifetimeScope

A class in Alta.LifetimeScopes, Alta.ATT.LifetimeScopes.

The root VContainer dependency injection scope for the whole game. Runs first (execution order -32000), survives scene loads, and only one may exist.

Constructors​

MemberWhat it is
ProjectLifetimeScope()Creates a ProjectLifetimeScope with default values.

Fields​

5 private and internal fields
MemberWhat it is
private AnalyticsInstaller analyticsInstallerPrivate: installs the analytics services.
private static ProjectLifetimeScope instancePrivate: the one live scope, used to reject duplicates.
private LoadingScreenFactory loadingScreenFactoryPrivate: the loading screen factory bound into the container.
private static readonly Logger loggerPrivate: logger for startup and quit messages.
private GlobalSettingsInstaller settingsInstallerPrivate: installs the global settings assets.

Methods​

MemberWhat it is
protected override void Awake()Destroys itself if another instance exists, otherwise becomes the root scope, builds the container and hooks application quit.
protected override void ConfigureScope(IContainerBuilder builder)Registers the game's services: static project registrations, the disposer, global settings, analytics, the loading screen factory and the Township event bus.
4 private and internal methods
MemberWhat it is
private void OnApplicationQuit()Private: starts OnApplicationQuitRoutine when the application quits.
private IEnumerator OnApplicationQuitRoutine() (iterator)Private: at the end of the frame, disposes the container and destroys the scope's object.
private static void RegisterAltaLifecycle(IContainerBuilder builder)Private: binds IDisposer to a new Disposer for each request.
private static void SetBuildVersionForEditorRuntime()Private: empty in this build.

Used in​

Members of other types that take, return or hold a ProjectLifetimeScope: