enableable-component

Toggle Unity DOTS IEnableableComponent states without archetype migration.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the need to pause and resume an entity’s behavior in Unity DOTS without paying the cost and complexity of structural archetype changes.

Core Features & Use Cases

  • Enable/Disable components efficiently: Toggle an IEnableableComponent while preserving its data, avoiding AddComponent/RemoveComponent churn.
  • Correct querying of enabled vs disabled entities: Use query filters like enabled-only, disabled-only, present, and IgnoreComponentEnabledState when you must see both.
  • Job-safe activation control: Update enabled state in parallel using EnabledRefRW<T>/EnabledRefRO<T> or EntityCommandBuffer.SetComponentEnabled<T> as appropriate.

Example use case: frequently switching “Sleeping vs Awake” behavior for thousands of agents each frame without migrating archetypes.

Quick Start

Ask your AI to implement IEnableableComponent for your state (e.g., Sleeping), then toggle it via EnabledRefRW<T> in a system query that ignores enable-state when you need to process both enabled and disabled entities.

Frequently Asked Questions about enableable-component

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

FAQPage Schema
How do I toggle Unity DOTS component behavior without triggering archetype changes?

Use `EnabledRefRW<T>` for direct component mutation in parallel jobs, or `EntityCommandBuffer.SetComponentEnabled<T>` for deferred, safe structural changes. Both allow safe enabled-state mutation without archetype migration.

How do I query both enabled and disabled entities in Unity ECS?

Use query filters like enabled-only, disabled-only, or `IgnoreComponentEnabledState` to correctly target entities. This ensures you process the right subset of entities based on their active behavior state.

What is the best way to switch state for thousands of Unity ECS entities every frame?

Use `IEnableableComponent` to toggle states like sleeping/awake or visible/invisible. This avoids `AddComponent` and `RemoveComponent` churn, preventing structural archetype changes while preserving component data.

Can I update enableable component state in parallel Unity DOTS jobs?

Yes, you can safely update enableable component state in parallel jobs. Use `EnabledRefRW<T>` for direct mutation or `EntityCommandBuffer.SetComponentEnabled<T>` for deferred changes within your Unity DOTS systems.

When should I avoid using AddComponent and RemoveComponent for entity state in Unity DOTS?

Avoid using `AddComponent` and `RemoveComponent` for high-frequency on/off state patterns like sleeping/awake. These cause structural archetype migration; use enableable components instead to toggle behavior without churn.