unity-singleton-pattern

Installation
SKILL.md

Unity Singleton Pattern

A robust suite of Singleton variations for global systems. Adheres to the Ohm-Yura project rule: "Use Singletons ONLY for global systems (GameManager, UIManager, InputManager)."

Core Features

  1. Singleton: Standard management. Destroys new duplicates to keep the original.
  2. PersistentSingleton: Extends Singleton with Don't Destroy On Load (DDOL) for cross-scene state.
  3. RegulatorSingleton: Advanced inverse logic. Destroys OLD instances and keeps the NEWEST (useful for hot-swapping).
  4. StaticInstance: Lightweight global access without duplication enforcement.

Core Files (Max 3)

  • SingletonBase.cs.txt: Generic base classes for classic and persistent variants.
  • SingletonRegulator.cs.txt: Logic for the time-stamped regulator variant.
  • SingletonExample.cs.txt: Concrete examples for Game and UI managers.

Usage

Installs
19
GitHub Stars
9
First Seen
Apr 19, 2026
unity-singleton-pattern — muharremtozan/unity-agent-skills