addressables-design
Source-anchored design rules for Unity Addressables 1.22.3/2.9.1
Edit material and shader properties across Built-in/URP/HDRP
$ npx -y skills add Besty0728/Unity-Skills --skill material --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/materialContext preview
The summary Claude sees to decide when to auto-load this skill.
Edit material and shader properties across Built-in/URP/HDRP
name: unity-material description: Edit material and shader properties across Built-in/URP/HDRP
> **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/materials.
**DO NOT** (common hallucinations):
**Routing**:
> ⚠️ **Targeting a GameObject edits the material asset, not that one object.** There is no per-object material instance here: every `material_set_*` resolves a GameObject to `renderer.sharedMaterial` and writes **the asset on disk** — an asset mutation, not a scene edit, whatever the individual skill's declared flags say. A freshly created primitive carries Unity's built-in `Default-Material`, so `material_set_color(name="Cube")` recolours *every* object in the project still using it — the classic "I coloured one cube and the whole scene changed" bug. Target by GameObject name only after confirming that object owns a material nobody else shares (`material_get_properties` → `materialPath` names the asset that would be written).
**Safe route for "make this object red"** — create, colour the asset by path, then assign:
unity_skills.call_skill("material_create", name="Red", savePath="Assets/Materials")
unity_skills.call_skill("material_set_color", path="Assets/Materials/Red.mat", r=1, g=0, b=0)
unity_skills.call_skill("material_assign", name="Cube", materialPath="Assets/Materials/Red.mat")> **Object Targeting**: Most single-object skills accept `name` (GameObject name) **or** `path`. Behaviour of `path`: > - In `material_set_*` / `material_get_*` (color/emission/texture/float/int/vector/keyword/shader/render_queue/gi_flags/properties), `path` may be either a **GameObject hierarchy path** *or* a **material asset path** like `Assets/Materials/X.mat` — the skill auto-detects (paths starting with `Assets/` or ending with `.mat` are treated as material assets). > - In `material_assign`, `path` is a **GameObject hierarchy path only**; the material to assign goes in the separate `materialPath` parameter.
| Single Object | Batch Version | Use Batch When | |---------------|---------------|----------------| | `material_create` | `material_create_batch` | Creating 2+ materials | | `material_assign` | `material_assign_batch` | Assigning to 2+ objects | | `material_set_color` | `material_set_colors_batch` | Setting colors on 2+ objects | | `material_set_emission` | `material_set_emission_batch` | Setting emission on 2+ objects |
**No batch needed**:
---
Create a new material (auto-detects render pipeline).
| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | `name` | string | Yes | - | Material name | | `shaderName` | string | No | auto-detect | Shader (auto-detects URP/HDRP/Standard) | | `savePath` | string | No | null | Save path (folder or full path) |
Create multiple materials. | Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | `items` | json string | Yes | - | JSON array of per-item objects (see example below) |
**Returns**: `{success, totalItems, successCount, failCount, results: [{success, name, path}]}`
unity_skills.call_skill("material_create_batch", items=[
{"name": "Red", "savePath": "Assets/Materials"},
{"name": "Blue", "savePath": "Assets/Materials"},
{"name": "Green", "savePath": "Assets/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)