Skip to content
Development
Skill

/scriptableobject

Manage ScriptableObject assets

From plugin
unity-skills
1.8k82 skills4 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

SKILL.md

scriptableobject.SKILL.md
name: unity-scriptableobject
description: Manage ScriptableObject assets

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

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`,可直接执行(注意 `scriptableobject_export_json` 传 `savePath` 会落盘,因此标 `MutatesAssets = true` 而非 `ReadOnly`);写类 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, the
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
Stats
1,761
Stars
164
Forks
Active
Maintenance
C#
Language
MIT
License
1d ago
Last commit
8mo ago
Created

Repo: Besty0728/Unity-Skills

Other skills on unity-skills.