addressables-design
Source-anchored design rules for Unity Addressables 1.22.3/2.9.1
Manage GameObject components
$ npx -y skills add Besty0728/Unity-Skills --skill component --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/componentContext preview
The summary Claude sees to decide when to auto-load this skill.
Manage GameObject components
name: unity-component description: Manage GameObject components
> **Before calling any skill in this module:** if you are about to call a skill with parameters guessed from its name or description, STOP — read this file (or fetch its schema via `GET /skills/recommend?includeSchema=true`) first. If you already have the parameter definitions from recommend/schema, you may proceed straight to dryRun.
> **BATCH-FIRST**: Use `*_batch` skills when operating on 2+ objects to reduce API calls from N to 1.
**DO NOT** (common hallucinations):
**Routing**:
> **Object Targeting**: All single-object skills accept `name` (string), `instanceId` (int, preferred), and `path` (string, hierarchy path). Provide at least one.
| Single Object | Batch Version | Use Batch When | |---------------|---------------|----------------| | `component_add` | `component_add_batch` | Adding to 2+ objects | | `component_remove` | `component_remove_batch` | Removing from 2+ objects | | `component_set_property` | `component_set_property_batch` | Setting on 2+ objects | | `component_set_serialized_property` | `component_set_serialized_property_batch` | Setting Inspector SerializedProperty paths |
**Other Skills** (no batch):
---
Add a component to a GameObject.
| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `name` | string | No* | GameObject name | | `instanceId` | int | No* | Instance ID (preferred) | | `path` | string | No* | Hierarchy path | | `componentType` | string | Yes | Component type name |
*At least one identifier required
**Returns**: `{success, gameObject, instanceId, component, fullTypeName}` (returns `{warning, gameObject, instanceId}` instead if a single-instance component already exists)
Remove a component from a GameObject.
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | `name` | string | No* | - | GameObject name | | `instanceId` | int | No* | - | Instance ID | | `path` | string | No* | - | Hierarchy path | | `componentType` | string | Yes | - | Component type to remove | | `componentIndex` | int | No | 0 | Index into the components of that type when 2+ exist on the same object |
**Returns**: `{success, gameObject, removed}` (`removed` is the requested `componentType` string)
List all components on a GameObject.
| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `name` | string | No* | GameObject name | | `instanceId` | int | No* | Instance ID |
**Returns**: `{gameObject, instanceId, path, componentCount, components: [{type, fullType, enabled, keyProperties?}]}` (`keyProperties` only present when `includeProperties=true`)
Set a component property value.
| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `name` | string | No* | GameObject name | | `instanceId` | int | No* | Instance ID | | `path` | string | No* | Hierarchy path | | `componentType` | string | Yes | Component type | | `propertyName` | string | Yes | C# property/field name — see the serialized-name note below | | `value` | string | Cond. | New value (basic types, vectors, colors, enums) — wire format below | | `referencePath` | string | No | Scene object hierarchy path (for scene references) | | `referenceName` | string | No | Scene object name (for scene references) | | `assetPath` | string | No | Project asset path (for asset references: Material, Texture, AudioClip, ScriptableObject, Prefab, etc.) |
**Which of the four value parameters to use** — exactly one carries the payload, and they are checked in this order: `assetPath` first, then `referencePath` / `referenceName`, and `value` only if neither reference form was supplied. So a `value` sent alongside an `assetPath` is silently ignored; never send two.
| Use | When the target field is | Example | |---|---|---| | `value` | a primitive, vector, colour, enum, `LayerMask`, `Rect`, `Bounds`, `Quaternion` | `value="2.5"`, `value="Interpolate"` | | `referencePath` | a scene object, addressed by hierarchy path (unambiguous) | `referencePath
REST API-based AI-driven Unity Editor Automation Engine Let AI control Unity scenes directly through Skills 🎉 We are now indexed by DeepWiki! Got questions? Check out the AI-generated docs → The current official maintenance baseline is Unity 2022.3+.
Source-anchored design rules for Unity Addressables 1.22.3/2.9.1
Manage Addressables groups, entries, profiles and content builds (com.unity.addressables, reflection-based)