Singletons
The Singletons subsystem provides a generic, attribute-driven singleton pattern for the three Paragon base object types: MonoBehaviour, plain C# object, and ScriptableObject. Each singleton variant uses a lazy-initialization chain (find → load → create) with auto-creation of persistent assets in the editor, and an optional auto-initialization system that eagerly loads singletons at startup.
Architecture
Initialization Flow
Key Concepts
Lazy initialization
Singletons are created on first access to Instance. The resolution chain varies by type (find → load → create).
Auto-creation
In the editor, if no asset exists, one is automatically created and saved to Resources/{AssetPath}.
[SingletonSettings]
Attribute controlling behavior: asset path, DontDestroyOnLoad, InitializeOnLoad, visibility flags.
SingletonInitializer
Runs before scene load, eagerly initializes all singletons marked InitializeOnLoad = true.
Three variants
SingletonBehaviour<T> (MonoBehaviour), SingletonScriptableObject<T> (ScriptableObject), SingletonObject<T> (plain C#).
Quick Start
MonoBehaviour Singleton
ScriptableObject Singleton
Plain C# Object Singleton
Classes
MonoBehaviour singleton — find → load → create chain, DontDestroyOnLoad support
Plain C# singleton — creates via new T(), no Unity asset backing
ScriptableObject singleton — load → create chain, auto-saves .asset in editor
Attribute controlling singleton behavior (asset path, initialization, visibility)
Runtime bootstrap that eagerly initializes InitializeOnLoad singletons
See Also
Objects System — parent system with Paragon base types
ParagonBehaviour — base class for
SingletonBehaviourParagonScriptableObject — base class for
SingletonScriptableObjectParagonObject — base class for
SingletonObject
Last updated