Table of Contents

Property Instance

Namespace
GrindFest
Assembly
GrindFest.dll

Instance

The one instance: looked up in the loaded scenes, created if it is not there.

A manager wired up in the inspector (GameManager, SaveManager, PartyController, ...) is found by the lookup and nothing else happens. A manager that owns nothing but data (BotProfileStore) has no reason to live in a scene at all, so the first read builds its object instead. Either way X.Instance is never null in play mode and callers just use it - no null checks, and no per-class override duplicating this logic.

Outside play mode a missing singleton still answers null: creating scene objects from an editor tick is what once left hundreds of stray GameObjects in the open scene.

public static T Instance { get; }

Property Value

T