一键导入
unity-prefab
Use when users want to create, instantiate, apply, or unpack prefabs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when users want to create, instantiate, apply, or unpack prefabs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | unity-prefab |
| description | Use when users want to create, instantiate, apply, or unpack prefabs. |
BATCH-FIRST: Use
prefab_instantiate_batchwhen spawning 2+ prefab instances.
DO NOT (common hallucinations):
prefab_create_from_object does not exist → use prefab_create (takes scene object name/instanceId and savePath)prefab_spawn does not exist → use prefab_instantiateprefab_edit / prefab_modify do not exist → use prefab_set_property (edit prefab asset directly) or instantiate, modify, then prefab_applyprefab_save does not exist → use prefab_apply (applies instance changes to source prefab)Routing:
component module skills, then prefab_applyprefab_set_property (this module)prefab_find_instances (this module)| Single Object | Batch Version | Use Batch When |
|---|---|---|
prefab_instantiate | prefab_instantiate_batch | Spawning 2+ instances |
No batch needed:
prefab_create - Create prefab from scene objectprefab_apply - Apply instance changes to prefabprefab_unpack - Unpack prefab instanceprefab_get_overrides - Get instance overridesprefab_revert_overrides - Revert to prefab valuesprefab_apply_overrides - Apply overrides to prefabprefab_create_variant - Create a prefab variantprefab_find_instances - Find all instances of a prefab in sceneprefab_set_property - Set a property on a component inside a Prefab asset (supports basic types, vectors, colors, and asset references)Create a prefab from a scene GameObject.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | No* | Source object name |
instanceId | int | No* | Instance ID |
path | string | No* | Object path |
savePath | string | Yes | Prefab save path |
Returns: {success, prefabPath, sourceObject}
Instantiate a prefab into the scene.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prefabPath | string | Yes | - | Prefab asset path |
name | string | No | prefab name | Instance name |
x, y, z | float | No | 0 | Local position (relative to parent if set) |
parentName | string | No | null | Parent object name |
parentInstanceId | int | No | 0 | Parent instance ID |
parentPath | string | No | null | Parent hierarchy path |
Returns: {success, name, instanceId, path, prefabPath, position}
Instantiate multiple prefabs in one call.
| Parameter | Type | Required | Description |
|---|---|---|---|
items | array | Yes | Array of instantiation configs |
Item properties: prefabPath, name, x, y, z, rotX, rotY, rotZ, scaleX, scaleY, scaleZ, parentName, parentInstanceId, parentPath
Returns: {success, totalItems, successCount, failCount, results: [{success, name, instanceId, prefabPath, position}]}
Recipe path rule: ../../recipes/prefab/<command>.md
Apply instance changes back to the prefab asset.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | No* | Prefab instance name |
instanceId | int | No* | Instance ID |
path | string | No* | Object path |
Returns: {success, gameObject, prefabPath}
Unpack a prefab instance (break prefab connection).
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | No* | - | Prefab instance name |
instanceId | int | No* | - | Instance ID |
path | string | No* | - | Object path |
completely | bool | No | false | Unpack all nested prefabs |
Returns: {success, gameObject, mode}
Get list of property overrides on a prefab instance.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | No* | Prefab instance name |
instanceId | int | No* | Instance ID |
Returns: {success, overrides: [{type, path, property}]}
Revert all overrides on a prefab instance back to prefab values.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | No* | Prefab instance name |
instanceId | int | No* | Instance ID |
Apply all overrides from instance to source prefab asset.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | No* | Prefab instance name |
instanceId | int | No* | Instance ID |
Create a prefab variant from an existing prefab.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
sourcePrefabPath | string | Yes | - | Path to the source prefab asset |
variantPath | string | Yes | - | Save path for the new variant |
Returns: { success, sourcePath, variantPath, name }
Find all instances of a prefab in the current scene.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prefabPath | string | Yes | - | Prefab asset path to search for |
limit | int | No | 50 | Maximum number of instances to return |
Returns: { success, prefabPath, count, instances: [{ name, path, instanceId }] }
Set a property on a component inside a Prefab asset file (without instantiating it). Supports basic types, vectors, colors, enums, and asset references.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prefabPath | string | Yes | - | Path to the prefab asset |
componentType | string | Yes | - | Component type name |
propertyName | string | Yes | - | Serialized property name |
value | string | Cond. | null | Value for basic types (int/float/bool/string/enum/vector/color) |
assetReferencePath | string | Cond. | null | Asset path for Object reference fields (Material, Texture, AudioClip, ScriptableObject, etc.) |
gameObjectName | string | No | null | Child object name inside prefab (defaults to root) |
Provide either
value(basic types) orassetReferencePath(asset references).
Returns: { success, prefabPath, gameObject, component, property, valueSet }
Use when working with a Unity project via MCP — creating or editing scenes, GameObjects, components, prefabs, materials, UI, lighting, navmesh, animations, terrain, C# scripts, or any other Unity Editor task.
Use when users want to run Unity tests or read test results.
Use when users want to enter play mode, select objects, undo/redo, or execute menu commands.
Use when creating, reading, editing, searching, validating, or deleting C# scripts in a Unity project.
Use when about to write or install a custom Editor script, add a [MenuItem], build a custom Editor window, or create a one-off Editor helper — to check whether a ready-to-paste template already exists in tooling/<domain>/ before reaching for Unity_CreateScript.
Use when users want to create Canvas, Button, Text, Image, or other UI elements.