What problem does it solve?
This Skill prevents silent misuse of DOTS “singletons” by establishing the correct single-entity, single-writer mental model and the required Unity Entities APIs so your code doesn’t fail unpredictably when more than one matching entity exists.
Core Features & Use Cases
- Correct DOTS singleton contracts: Define singleton components as living on exactly one entity and access them through SystemAPI (GetSingleton, GetSingletonRW, HasSingleton, TryGetSingleton).
- Creation pathway guidance: Choose and document bake-time, runtime-created, or ECB-system singletons based on immutability and ownership.
- Safety gating and runtime invariants: Use RequireForUpdate for strict existence guarantees, avoid invalid job-time access patterns, and validate the “exactly one entity” invariant to catch duplicated or missing singletons early.
- Single-writer rule enforcement: Prevent multiple writers from using GetSingletonRW for the same component, protecting determinism and dependency ordering.
Quick Start
Use dots-singleton-patterns when you need a frame-stable shared configuration or mutable shared state in Unity DOTS that must exist on exactly one entity, then implement RequireForUpdate plus GetSingleton/GetSingletonRW to enforce the invariant at runtime.