batch-structural-change-on-query

Community

Batch structural changes safely and fast

AuthordyCuong03
Version1.0.0
Installs0

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 EntityQuery without 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.Query foreach 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 required

Components

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.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.