What problem does it solve?
Create a reusable Unity DOTS EntityCommandBuffer (ECB) that can be safely played back multiple times, avoiding failures that happen when you try to reuse a SinglePlayback ECB in streaming or repeated-load scenarios.
Core Features & Use Cases
- Reusable MultiPlayback ECB: Build an ECB using PlaybackPolicy.MultiPlayback so the same command sequence can be replayed on demand.
- Persistent Lifetime Management: Use Allocator.Persistent for the ECB so it remains valid across multiple subscene loads and does not get freed too early.
- Component-Scoped Command Storage: Store the ECB in a component (e.g., an IComponentData field) and call Playback each time a subscene section loads, then Dispose when the owning entity is destroyed.
- Streaming/Repeated Load Use Case: Ideal for systems where an entity creation script must run every time a subscene loads (e.g., streaming tiles/sections that reload repeatedly).
Quick Start
Tell the assistant to generate an IComponentData that stores a Persistent MultiPlayback EntityCommandBuffer, call Playback on each subscene load, and Dispose the ECB when the owning entity is destroyed.