chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"label": "scripting_ext",
|
||||
"link": {
|
||||
"type": "doc",
|
||||
"id": "reference/tools/scripting_ext/index"
|
||||
},
|
||||
"collapsed": true
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
---
|
||||
title: execute_code
|
||||
sidebar_label: execute_code
|
||||
description: "Execute arbitrary C# code inside the Unity Editor."
|
||||
---
|
||||
|
||||
# `execute_code`
|
||||
|
||||
> **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.execute_code`
|
||||
|
||||
## Description
|
||||
|
||||
Execute arbitrary C# code inside the Unity Editor. The code runs as a method body with access to UnityEngine and UnityEditor namespaces. Use 'return' to send data back. Compiled in-memory — no script files created. Actions: execute (run code), get_history (list past executions), replay (re-run a history entry), clear_history. NOTE: safety_checks blocks known dangerous patterns but is not a full sandbox. Compiler options: 'auto' (Roslyn if available, else CodeDom), 'roslyn' (C# 12+, requires Microsoft.CodeAnalysis), 'codedom' (C# 6 only).
|
||||
|
||||
## Parameters
|
||||
|
||||
| Name | Type | Required | Description |
|
||||
|------|------|----------|-------------|
|
||||
| `action` | `Literal['execute', 'get_history', 'replay', 'clear_history']` | yes | Action to perform. |
|
||||
| `code` | `str \| None` | — | C# code to execute (for 'execute' action). Must be a valid method body. Access UnityEngine and UnityEditor namespaces. Use 'return' to send data back. |
|
||||
| `safety_checks` | `bool` | — | Enable basic blocked-pattern checks (File.Delete, Process.Start, infinite loops, etc). Not a full sandbox — advanced bypass is possible. Default: true. |
|
||||
| `index` | `int \| None` | — | History entry index to replay (for 'replay' action). |
|
||||
| `limit` | `int` | — | Number of history entries to return (for 'get_history' action, 1-50). Default: 10. |
|
||||
| `compiler` | `Literal['auto', 'roslyn', 'codedom']` | — | Compiler backend for 'execute' action. 'auto' uses Roslyn if Microsoft.CodeAnalysis is installed, else falls back to CodeDom. 'roslyn' forces Roslyn (C# 12+). 'codedom' forces legacy CSharpCodeProvider (C# 6). Default: auto. |
|
||||
|
||||
## Returns
|
||||
|
||||
A `dict` containing the Unity response. The exact shape depends on the action.
|
||||
|
||||
## Examples
|
||||
|
||||
<!-- examples:start -->
|
||||
*No examples yet. Add usage examples here — they will be preserved across regenerations.*
|
||||
<!-- examples:end -->
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: "scripting_ext tools"
|
||||
sidebar_label: "scripting_ext"
|
||||
description: "MCP for Unity tools in the scripting_ext group."
|
||||
---
|
||||
|
||||
# `scripting_ext` tools
|
||||
|
||||
ScriptableObject management
|
||||
|
||||
- **[`execute_code`](./execute_code.md)** — Execute arbitrary C# code inside the Unity Editor.
|
||||
- **[`manage_scriptable_object`](./manage_scriptable_object.md)** — Creates and modifies ScriptableObject assets using Unity SerializedObject property paths.
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
title: manage_scriptable_object
|
||||
sidebar_label: manage_scriptable_object
|
||||
description: "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
|
||||
|
||||
<!-- examples:start -->
|
||||
*No examples yet. Add usage examples here — they will be preserved across regenerations.*
|
||||
<!-- examples:end -->
|
||||
|
||||
Reference in New Issue
Block a user