wave8-ijobchunk-use-enabled-mask-guard

Iterate only enabled entities in Unity ECS IJobChunk using useEnabledMask and ChunkEntityEnumerator.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you correctly handle IEnableableComponent bitmasks in Unity ECS IJobChunk jobs so you never process disabled entities or accidentally skip enabled ones.

Core Features & Use Cases

  • Correct enabled-entity iteration: Uses the useEnabledMask flag and ChunkEntityEnumerator to iterate only enabled entities within a chunk.
  • Safe performance-aware fast path: Falls back to a simple for loop when useEnabledMask is false to avoid unnecessary mask overhead.
  • Job-choice guidance: Recommends using IJobEntity when possible because it handles enableable masks automatically, and uses this guard only when IJobChunk is required.

Use Case Example: When building a state-machine style simulation where some entities (e.g., Active/Sleeping/Dead variants) are enableable, applying this guard ensures only active (enabled) entities get updated each frame.

Quick Start

Tell your AI assistant to review your IJobChunk implementation and ensure it iterates enabled entities using useEnabledMask and ChunkEntityEnumerator when the query includes any IEnableableComponent.

Frequently Asked Questions about wave8-ijobchunk-use-enabled-mask-guard

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

FAQPage Schema
How do I iterate only enabled entities in Unity ECS IJobChunk?

To iterate only enabled entities in Unity ECS IJobChunk, check the `useEnabledMask` flag and use a `ChunkEntityEnumerator` with the `chunkEnabledMask` to skip disabled entities when enableable component bitmasks are present.

Why does my IJobChunk process disabled entities with enableable components?

Your IJobChunk processes disabled entities because it lacks the enabled mask guard. When a query includes IEnableableComponent types, you must use `useEnabledMask` and `ChunkEntityEnumerator` to respect per-entity enabled and disabled states.

Do I need to use ChunkEntityEnumerator when useEnabledMask is false in IJobChunk?

You do not need to use `ChunkEntityEnumerator` when `useEnabledMask` is false. A fast path that loops over `chunk.Count` with a simple for loop avoids unnecessary mask overhead and yields better performance.

What is the best way to handle enabled masks in Unity DOTS: IJobEntity or IJobChunk?

The best way to handle enabled masks is using IJobEntity, because it processes enableable masks automatically. You should only use the IJobChunk enabled mask guard with `ChunkEntityEnumerator` when IJobChunk is explicitly required.

When do I need to check useEnabledMask in Unity ECS chunk-based jobs?

You need to check `useEnabledMask` in Unity ECS chunk-based jobs whenever your entity query includes any IEnableableComponent. This ensures state-machine style simulations only update active, enabled entities and skip sleeping or dead variants.

Can I use IJobChunk for state-machine simulations with enableable components?

You can use IJobChunk for state-machine simulations with enableable components by applying an enabled mask guard. This guard uses `useEnabledMask` and `ChunkEntityEnumerator` to ensure only active enabled entities receive simulation updates each frame.