Files
Shutong Wu bc9499b203 fix(docs-gen): smarter sentence split for frontmatter descriptions
PR #1157 review (Copilot + CodeRabbit) flagged that several tool pages
had truncated frontmatter, e.g. manage_asset rendering as:
  description: "Performs asset operations (import, create, modify, delete, etc"

Root cause: the generator used `description.split(".")[0]` to derive the
frontmatter blurb. That cuts at the FIRST period — including periods
inside abbreviations and parenthesized lists ("etc.) in Unity."), so
the rendered description stopped mid-clause.

Fix: introduce `_first_sentence()` that splits on real sentence
boundaries — `.` / `!` / `?` followed by whitespace + capital, or a
paragraph break — and falls back to the whole string if no boundary
exists. Also caps absurdly long single-sentence descriptions at ~240
chars to keep frontmatter compact.

All three call sites that used the old split:
- frontmatter `description:` in render_tool_page
- group-index bullets in render_group_index
- catalog-index bullets in render_catalog_index

Regenerated all 43 tool pages + 9 group landings + catalog index +
resources catalog. Verified `--check` passes round-trip and full
website build is clean.

manage_asset now reads: "Performs asset operations (import, create,
modify, delete, etc.) in Unity."
2026-05-25 02:56:06 +08:00

1.9 KiB

title, sidebar_label, description
title sidebar_label description
manage_scriptable_object manage_scriptable_object Creates and modifies ScriptableObject assets using Unity SerializedObject property paths.

manage_scriptable_object

Auto-generated from the Python tool registry. Do not hand-edit outside <!-- examples:start --><!-- examples:end --> blocks — the generator (tools/generate_docs_reference.py) will overwrite them.

Group: scripting_ext  ·  Module: services.tools.manage_scriptable_object

Description

Creates and modifies ScriptableObject assets using Unity SerializedObject property paths.

Parameters

Name Type Required Description
action Literal['create', 'modify'] yes Action to perform: create or modify.
type_name str | None Namespace-qualified ScriptableObject type name (for create).
folder_path str | None Target folder under Assets/... (for create).
asset_name str | None Asset file name without extension (for create).
overwrite bool | str | None If true, overwrite existing asset at same path (for create).
target dict[str, Any] | str | None Target asset reference {guid|path} (for modify).
patches list[dict[str, Any]] | str | None Patch list (or JSON string) to apply. For object references: use {"ref": {"guid": "..."}} or {"value": {"guid": "..."}}. For Sprite sub-assets: include "spriteName" in the ref/value object. Single-sprite textures auto-resolve from guid/path alone.
dry_run bool | str | None If true, validate patches without applying (modify only).

Returns

A dict containing the Unity response. The exact shape depends on the action.

Examples

No examples yet. Add usage examples here — they will be preserved across regenerations.