wave6-enabled-ref-rw-in-job

Read and write IEnableableComponent enabled bits within Unity DOTS jobs.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the performance and timing issues of enabling/disabling entities in Unity DOTS by letting you read and write the enabled bit of an IEnableableComponent directly inside a job execution path, avoiding ECB overhead and the one-frame delay from deferred playback.

Core Features & Use Cases

  • Inline enabled-bit reads/writes in IJobEntity: Use EnabledRefRW<T> to update the component enabled state within the same job pass.
  • Correct query behavior with disabled entities: Ensure queries include disabled entities by using EntityQueryOptions.IgnoreComponentEnabledState when you intend to process both enabled and disabled targets.
  • Same-frame bulk toggling: Apply proximity/LOD/range logic to bulk-enable or bulk-disable entities without structural changes or ECB playback.

Use case: you have thousands of entities and need proximity-based culling that turns an ActiveBehavior component on/off immediately within the same frame based on distance computed during the job.

Quick Start

Use EnabledRefRW<ActiveBehavior> inside an IJobEntity Execute method and add WithOptions(EntityQueryOptions.IgnoreComponentEnabledState) so the job can process both enabled and disabled entities in the same pass.

Frequently Asked Questions about wave6-enabled-ref-rw-in-job

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

FAQPage Schema
How do I change a component enabled state directly inside a Unity DOTS job?

Use EnabledRefRW<T> inside an IJobEntity Execute method to update the component enabled state directly during job execution. This approach reads and writes the enabled bit instantly within the same pass, bypassing structural changes and ECB overhead.

Can I avoid ECB deferred playback when bulk toggling entity components in Unity ECS?

Yes, you can avoid ECB deferred playback by writing to the enabled bit via EnabledRefRW<T> during job execution. This enables same-frame bulk toggling for proximity or LOD logic without waiting for ECB playback or triggering structural changes.

What query options are needed to process disabled entities in an IJobEntity?

Processing disabled entities in an IJobEntity requires adding WithOptions(EntityQueryOptions.IgnoreComponentEnabledState) to your query. This ensures the job iterates over both enabled and disabled targets for same-frame toggling decisions.

Why does my EnabledRefRW not update disabled entities during the Unity DOTS job?

Your EnabledRefRW might not update disabled entities because the query lacks EntityQueryOptions.IgnoreComponentEnabledState. You must apply this option so the job includes disabled entities and can write ValueRW to update their enabled state safely.

What are the limitations of using EnabledRefRW for ECS optimization?

The limitation of using EnabledRefRW for ECS optimization is that it applies specifically to proximity, LOD, or range-driven decisions within IJobEntity or SystemAPI.Query foreach. It requires EntityQueryOptions.IgnoreComponentEnabledState to process disabled entities and write ValueRW safely.