wave6-ecb-set-component-enabled

Record deferred enable/disable commands for IEnableableComponent types using EntityCommandBuffer parallel writer semantics.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you reliably record deferred enable/disable commands for IEnableableComponent types in Unity DOTS using a deterministic ordering, avoiding order-dependent playback issues in parallel jobs.

Core Features & Use Cases

  • Deferred parallel toggling: Record component enable/disable decisions from parallel IJobEntity or IJobChunk work using ECB.SetComponentEnabled<T>().
  • Deterministic playback: Use a deterministic sort key ([ChunkIndexInQuery]) so that conflicting commands for the same entity resolve predictably.
  • Cross-entity enable/disable: Enable or disable a different entity than the one being iterated when EnabledRefRW cannot be used.
  • Performance-safe guidance: Prefer ECB toggles over structural changes (AddComponent/RemoveComponent) for frequent runtime toggling.

Quick Start

Ask the agent to update your job so it uses ECB.SetComponentEnabled<T>(chunkIndex, entity, inRange) with a [ChunkIndexInQuery] parameter for deterministic parallel playback.

Frequently Asked Questions about wave6-ecb-set-component-enabled

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

FAQPage Schema
How do I enable or disable a component on a different entity in a parallel Unity DOTS job?

To enable or disable a component on a different entity in a parallel Unity DOTS job, use an EntityCommandBuffer parallel writer to record deferred SetComponentEnabled commands, since EnabledRefRW only works on the currently iterated entity.

Why do my EntityCommandBuffer enableable component commands cause order-dependent playback issues in parallel jobs?

Order-dependent playback issues in parallel jobs occur when conflicting ECB commands lack deterministic sorting. You must provide a deterministic sort key, like ChunkIndexInQuery, to SetComponentEnabled so the EntityCommandBuffer resolves predictably.

What is the best way to toggle IEnableableComponent types at runtime without causing structural changes in Unity DOTS?

The best way to toggle IEnableableComponent types without causing structural changes in Unity DOTS is using EntityCommandBuffer SetComponentEnabled commands. This performance-safe approach avoids the heavy overhead of AddComponent and RemoveComponent.

Can I use SetComponentEnabled with an EntityCommandBuffer in IJobEntity for cross-entity component toggling?

Yes, you can use SetComponentEnabled with an EntityCommandBuffer parallel writer in IJobEntity or IJobChunk. This allows you to conditionally toggle enableable components on entities other than the one currently being iterated.

When do I need to use a deterministic sort key for ECB parallel writer component toggling?

You need a deterministic sort key for ECB parallel writer component toggling whenever multiple parallel jobs record conflicting enable or disable commands for the same entity, ensuring predictable resolution at the next system boundary playback.

Does setting an enableable component via EntityCommandBuffer guarantee immediate visibility during the same frame in Unity DOTS?

No, setting an enableable component via EntityCommandBuffer does not guarantee immediate visibility. Playback applies at the appropriate ECB system timing, ensuring the component state changes are only visible at the next deterministic boundary.