batch-structural-change-on-query
CommunityBatch structural changes safely and fast
System Documentation
What problem does it solve?
It avoids slow, error-prone per-entity loops by enabling structural changes across all entities that match an ECS query in a single operation, reducing archetype thrash and eliminating iterator invalidation risks.
Core Features & Use Cases
- One-pass structural changes: Perform operations like destroy, add, remove, or enable/disable components across all entities selected by an
EntityQuerywithout iterating entities individually. - Performance-focused query usage: Apply query-level APIs for uniform changes where every matching entity should receive the same outcome.
- Safer ECS patterns: Help prevent runtime exceptions by avoiding query-overload structural changes inside active
SystemAPI.Queryforeach loops.
Real-world use case: cleaning up scene entities by destroying a set of matched enemies and removing a “wave complete” component from all remaining wave entities in one frame.
Quick Start
Ask the AI to rewrite your ECS system so it uses state.EntityManager.<Action>(m_Query) with a cached EntityQuery built once during OnCreate, rather than looping over entities and calling per-entity structural methods.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: batch-structural-change-on-query Download link: https://github.com/dyCuong03/unity-agent-team/archive/main.zip#batch-structural-change-on-query Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.