Skip to content
Development
Skill

/scriptableobject

Manage ScriptableObject assets. 管理 ScriptableObject 资产。

From plugin
unity-skills
1.6k74 skills5 commands
Install
$ npx -y skills add Besty0728/Unity-Skills --skill scriptableobject --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/scriptableobject

Context preview

The summary Claude sees to decide when to auto-load this skill.

Manage ScriptableObject assets. 管理 ScriptableObject 资产。

SKILL.md

scriptableobject.SKILL.md
name: unity-scriptableobject
description: Manage ScriptableObject assets. 管理 ScriptableObject 资产。

Triggers

  • Creating or editing SO data assets
  • Finding SO instances
  • Scripting SO management
  • 创建或编辑 ScriptableObject 数据资产、查找 SO 实例、脚本化管理 SO

ScriptableObject Skills

Create and manage ScriptableObject assets.

Operating Mode

  • **Approval**:本模块 Mixed —— `scriptableobject_get` / `scriptableobject_get_serialized_properties` / `scriptableobject_list_types` / `scriptableobject_find` / `scriptableobject_export_json` 标 `SkillMode.SemiAuto`,可直接执行;写类 skill (`scriptableobject_create` / `scriptableobject_set` / `scriptableobject_set_batch` / `scriptableobject_set_serialized_property` / `scriptableobject_set_serialized_property_batch` / `scriptableobject_duplicate` / `scriptableobject_import_json`) 标 `SkillMode.FullAuto`,需 grant 单次执行返结果。
  • **Auto / Bypass**:FullAuto 直接执行。
  • **含 NeverInSemi 高危 skill**:`scriptableobject_delete`(Operation.Delete)。该 skill 在 Approval/Auto 下返 `MODE_FORBIDDEN`,仅 Bypass 或 Allowlist 命中可调。

**DO NOT** (common hallucinations):

  • `scriptableobject_create_type` does not exist → create SO scripts via `script_create` with template "ScriptableObject"
  • `scriptableobject_get_properties` / `scriptableobject_read` do not exist → use `scriptableobject_get` (reflection view) or `scriptableobject_get_serialized_properties` (Inspector/serialized view)
  • `scriptableobject_set_property` / `scriptableobject_set_field` do not exist → use `scriptableobject_set` (top-level public field) or `scriptableobject_set_serialized_property` (nested/array/reference/private)
  • `scriptableobject_save` does not exist → changes are auto-saved to the asset

**Routing**:

  • For ScriptableObject script creation → use `script` module with template "ScriptableObject"
  • For JSON import/export → `scriptableobject_import_json` / `scriptableobject_export_json` (this module)
  • Choosing a setter: `scriptableobject_set` / `scriptableobject_set_batch` only reach top-level public simple fields (reflection). For nested paths, arrays/lists, object references, private `[SerializeField]` fields, gradients, curves and `[Flags]` enums → `scriptableobject_set_serialized_property` (+ `_batch`).

Skills

`scriptableobject_create`

Create a new ScriptableObject asset. **Parameters:**

  • `typeName` (string): ScriptableObject type name.
  • `savePath` (string): Asset save path.

`scriptableobject_get`

Get properties of a ScriptableObject. **Parameters:**

  • `assetPath` (string): Asset path.

`scriptableobject_set`

Set a top-level public field/property on a ScriptableObject via reflection. For nested paths, arrays, object references or private `[SerializeField]` fields use `scriptableobject_set_serialized_property`. **Parameters:**

  • `assetPath` (string): Asset path.
  • `fieldName` (string): Field or property name.
  • `value` (string): Value to set.

`scriptableobject_list_types`

List available ScriptableObject types in the project. **Parameters:**

  • `filter` (string, optional): Filter by name.

`scriptableobject_duplicate`

Duplicate a ScriptableObject asset. **Parameters:**

  • `assetPath` (string): Source asset path to duplicate.

`scriptableobject_set_batch`

Set multiple fields on a ScriptableObject at once. fields: JSON object {fieldName: value, ...}

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | assetPath | string | Yes | - | Asset path of the ScriptableObject | | fields | string | Yes | - | JSON object with field-value pairs, e.g. `{"fieldName": "value", ...}` |

**Returns:** `{ success, fieldsSet }`

`scriptableobject_get_serialized_properties`

List Inspector serialized properties of a ScriptableObject asset — `propertyPath`, type, and current value for every serialized field, including private `[SerializeField]` and nested/array children. Use the returned `propertyPath` values with `scriptableobject_set_serialized_property`.

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | assetPath | string | Yes | - | Asset path of the ScriptableObject | | includeChildren | bool | No | `true` | Recurse into nested/array child properties | | limit | int | No | `200` | Maximum number of properties to return |

**Returns:** `{ success, path, typeName, properties: [{ propertyPath, name, displayName, propertyType, type, isArray, editable, value }] }`

`scriptableobject_set_serialized_property`

Set a single Inspector serialized property by `propertyPath`. Works where `scriptableobject_set` cannot: nested fields, arrays/lists, `UnityEngine.Object` references, private `[SerializeField]` fields, gradients, animation curves, and `[Flags]` enums.

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | assetPath | string | Yes | - | Asset path of the target ScriptableObject | | propertyPath | string | Yes | - | Serialized property path (see syntax below); `speed` auto-falls back to `m_Speed` / `_speed` | | value | string | No | `null` | Value to set (format depends on property type) | | valueAssetPath | string | No | `null` | For ObjectReference properties: asset path of the asset to reference | | valueObjectType | string | No | `null` | Optional type filter for the referenced asset (e.g. `"Sprite"`, useful for sub-assets) |

**propertyPath syntax:**

  • Top-level field: `speed`
  • Nested field: `stats.maxHp`
  • Array/List element: `items.Array.data[2]`
  • Array/List resize: `items.Array.size` with `value: "5"` (resize first, then set elements)

**Value formats:**

  • Primitives: `"3.5"` / `"true"` / `"hello"`; Vector: `"1,2,3"`; Color: `"1,0,0,1"`; Enum: index or name
  • `[Flags]` enum: comma-separated names `"Fire,Ice"` (also `|`), or a raw bitmask number (`"3"`, `"-1"` = Everything)
  • ObjectReference: pass `valueAssetPath: "Assets/Icons/sword.png"` (optionally `valueObjectType`); clear with `value: "null"`
  • Gradient: `{"colorK
Read more
Ships withunity-skills

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+.

Get the whole plugin