What problem does it solve?
This Skill solves Unity DOTS entity-lifecycle bugs where structural changes invalidate queries and stale Entity handles cause exceptions or orphan references.
Core Features & Use Cases
- ECB-safe structural changes during iteration: record DestroyEntity/Add/Remove intent in an EntityCommandBuffer instead of mutating the world mid-query.
- Two-phase teardown with ICleanupComponentData: defer true destruction until a dedicated phase removes the cleanup component.
- Stale Entity validation & dangling ref debugging: safely check Exists/HasComponent before dereferencing and understand (Index, Version) generation behavior.
- Subscene load/unload and orphan reference mitigation: avoid refs that become invalid when subscene-owned entities unload.
- Failure-mode driven guidance: target common symptoms like “entity already destroyed,” immortal tombstones, and cleanup order mistakes.
Quick Start
Use dots-entity-lifecycle when you need to destroy DOTS entities safely during gameplay, implement ICleanupComponentData two-phase cleanup, and debug invalid/dangling Entity reference failures.