ecb-multiplayback

Replay persistent Unity DOTS EntityCommandBuffer sequences across repeated subscene loads.

6|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/dyCuong03/unity-agent-team --skill ecb-multiplayback
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ecb-multiplayback
Source: https://github.com/dyCuong03/unity-agent-team/tree/main/.claude/skills/unity-dots/ecb-multiplayback
Command: npx skills add https://github.com/dyCuong03/unity-agent-team --skill ecb-multiplayback

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about ecb-multiplayback

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my Unity DOTS EntityCommandBuffer fail when replaying subscene loads?

Using a SinglePlayback EntityCommandBuffer fails on replay because it is invalidated after one invocation. You must use PlaybackPolicy.MultiPlayback to safely replay entity-creation command sequences across repeated subscene loads.

How do I reuse an EntityCommandBuffer for multiple subscene section loads in Unity DOTS?

To reuse an EntityCommandBuffer, create it with PlaybackPolicy.MultiPlayback and Allocator.Persistent, store it in an IComponentData field, and call Playback each time the subscene section loads.

What memory allocator is needed for a reusable EntityCommandBuffer in streaming scenarios?

A reusable EntityCommandBuffer in streaming scenarios requires Allocator.Persistent. This keeps the ECB valid across multiple subscene loads and prevents early memory deallocation.

How do I prevent memory leaks when using a MultiPlayback EntityCommandBuffer?

To prevent memory leaks with a MultiPlayback EntityCommandBuffer, you must explicitly call Dispose on the ECB when the owning entity is destroyed, as the persistent allocation is not garbage collected automatically.

Can I store a MultiPlayback EntityCommandBuffer inside an IComponentData component?

Yes, you can store a MultiPlayback EntityCommandBuffer in an IComponentData field. This component-scoped command storage allows the owning entity to invoke Playback during each subscene load lifecycle.

When should I use a MultiPlayback EntityCommandBuffer instead of creating a new one?

Use a MultiPlayback EntityCommandBuffer instead of creating new ones when an entity creation script must run every time a streaming tile or subscene reloads, avoiding the overhead of rebuilding command sequences.