What problem does it solve?
Prevent stale or incorrect runtime/baking outputs by reliably tracking entity lifecycle events (creation, re-parenting, and destruction) across incremental baking passes.
Core Features & Use Cases
- Lifecycle-aware cleanup component: Uses
ICleanupComponentData together with [BakingType] so cleanup survives entity destruction while the primary baked component is stripped from the runtime world.
- Destroyed-entity detection: Detects entities whose baked components disappeared but whose cleanup remains, then triggers recomputation for dependent parent-level data.
- Re-parenting handling: Stores the previous
Parent (or equivalent hierarchy reference) in the cleanup component and compares it to the current hierarchy to trigger correct updates.
- Stale-growth prevention: Removes the cleanup component after processing to avoid accumulating old cleanup records over multiple baking passes.
Quick Start
Add a [BakingType]-tagged ICleanupComponentData cleanup struct, write it onto newly baked entities, and on each bake pass recompute impacted parent-dependent data when cleanup entities are found without the corresponding baked components anymore.