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.