一大波优化
@@ -0,0 +1,154 @@
|
|||||||
|
---
|
||||||
|
name: assets-copy
|
||||||
|
description: Copy assets at given paths and store them at new paths. Refreshes the AssetDatabase at the end. Use 'assets-find' to locate the source assets first.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Assets / Copy
|
||||||
|
|
||||||
|
Copy assets at given paths and store them at new paths. Does AssetDatabase.Refresh() at the end. Use 'assets-find' tool to find assets before copying.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `sourcePaths` — paths of the assets to copy.
|
||||||
|
- `destinationPaths` — paths to store the copied assets (must match `sourcePaths` length).
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Each source/destination pair is copied in order. Per-pair errors are accumulated in the response instead of throwing, so a single bad pair does not abort the whole batch.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool assets-copy --input '{
|
||||||
|
"sourcePaths": "string_value",
|
||||||
|
"destinationPaths": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-copy --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-copy --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `sourcePaths` | `any` | Yes | The paths of the assets to copy. |
|
||||||
|
| `destinationPaths` | `any` | Yes | The paths to store the copied assets. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"sourcePaths": {
|
||||||
|
"$ref": "#/$defs/System.String-1"
|
||||||
|
},
|
||||||
|
"destinationPaths": {
|
||||||
|
"$ref": "#/$defs/System.String-1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.String-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"sourcePaths",
|
||||||
|
"destinationPaths"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.CopyAssetsResponse"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Collections.Generic.List(AIGD.AssetObjectRef)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.AssetObjectRef",
|
||||||
|
"description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.AssetObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders."
|
||||||
|
},
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(System.String)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.CopyAssetsResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"CopiedAssets": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(AIGD.AssetObjectRef)",
|
||||||
|
"description": "List of copied assets."
|
||||||
|
},
|
||||||
|
"Errors": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(System.String)",
|
||||||
|
"description": "List of errors encountered during copy operations."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
---
|
||||||
|
name: assets-create-folder
|
||||||
|
description: Create a new folder under a parent folder inside 'Assets/'. The parent path must start with 'Assets/' and every intermediate folder in it must already exist. Refreshes the AssetDatabase at the end and returns the GUID(s) of the created folder(s).
|
||||||
|
---
|
||||||
|
|
||||||
|
# Assets / Create Folder
|
||||||
|
|
||||||
|
Creates a new folder in the specified parent folder. The parent folder string must start with the 'Assets' folder, and all folders within the parent folder string must already exist. For example, when specifying 'Assets/ParentFolder1/ParentFolder2/', the new folder will be created in 'ParentFolder2' only if ParentFolder1 and ParentFolder2 already exist. Use it to organize scripts and assets in the project. Does AssetDatabase.Refresh() at the end. Returns the GUID of the newly created folder, if successful.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `inputs` — list of `{ParentFolderPath, NewFolderName}` entries. Each entry is processed independently; per-entry errors are collected in the response so a single bad input does not abort the batch.
|
||||||
|
|
||||||
|
## Validation
|
||||||
|
|
||||||
|
- `NewFolderName` must be non-empty and must not contain any of `/`, `\`, `<`, `>`, `:`, `"`, `|`, `?`, `*`, or control characters (these checks are cross-platform even on Linux/Mac).
|
||||||
|
- `ParentFolderPath` must already exist as an `AssetDatabase.IsValidFolder` path.
|
||||||
|
- A folder with the same target name must not already exist under the parent.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool assets-create-folder --input '{
|
||||||
|
"inputs": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-create-folder --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-create-folder --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `inputs` | `any` | Yes | The paths for the folders to create. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"inputs": {
|
||||||
|
"$ref": "#/$defs/AIGD.CreateFolderInput-1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.CreateFolderInput": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"ParentFolderPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The parent folder path where the new folder will be created."
|
||||||
|
},
|
||||||
|
"NewFolderName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The name of the new folder to create."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.CreateFolderInput-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.CreateFolderInput"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"inputs"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.CreateFolderResponse"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Collections.Generic.List(System.String)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.CreateFolderResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"CreatedFolderGuids": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(System.String)",
|
||||||
|
"description": "List of GUIDs of created folders."
|
||||||
|
},
|
||||||
|
"Errors": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(System.String)",
|
||||||
|
"description": "List of errors encountered during folder creation."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
---
|
||||||
|
name: assets-delete
|
||||||
|
description: Delete the assets at the given project paths. Refreshes the AssetDatabase at the end. Use 'assets-find' to locate the assets first.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Assets / Delete
|
||||||
|
|
||||||
|
Delete the assets at paths from the project. Does AssetDatabase.Refresh() at the end. Use 'assets-find' tool to find assets before deleting.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `paths` — project-relative asset paths to delete. Must be non-empty.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Routes through `AssetDatabase.DeleteAssets`, which deletes the batch atomically. Paths Unity reports as failed are surfaced in `response.Errors`; successfully deleted paths are surfaced in `response.DeletedPaths`. The tool is destructive (removes files from disk).
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool assets-delete --input '{
|
||||||
|
"paths": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-delete --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-delete --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `paths` | `any` | Yes | The paths of the assets |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"paths": {
|
||||||
|
"$ref": "#/$defs/System.String-1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.String-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"paths"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.DeleteAssetsResponse"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Collections.Generic.List(System.String)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.DeleteAssetsResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"DeletedPaths": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(System.String)",
|
||||||
|
"description": "List of paths of deleted assets."
|
||||||
|
},
|
||||||
|
"Errors": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(System.String)",
|
||||||
|
"description": "List of errors encountered during delete operations."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
---
|
||||||
|
name: assets-find-built-in
|
||||||
|
description: Search the built-in assets of the Unity Editor (located at Resources/unity_builtin_extra). Filters by name and/or type; built-in assets have no GUID so GUID-based lookups are not supported.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Assets / Find (Built-in)
|
||||||
|
|
||||||
|
Search the built-in assets of the Unity Editor located in the built-in resources: Resources/unity_builtin_extra. Doesn't support GUIDs since built-in assets do not have them.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `name` (optional) — case-insensitive name fragment. Underscores, hyphens, spaces, and periods delimit search words so partial-word matching works.
|
||||||
|
- `type` (optional) — restrict results to assets assignable to this type (e.g. `UnityEngine.Texture2D`).
|
||||||
|
- `maxResults` — cap on returned list size (default 10).
|
||||||
|
|
||||||
|
## Ranking
|
||||||
|
|
||||||
|
Results are sorted by descending match quality: exact match → substring match → all-words match → partial-words match. Within a rank, results are sorted alphabetically by filename for stable ordering.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool assets-find-built-in --input '{
|
||||||
|
"name": "string_value",
|
||||||
|
"type": "string_value",
|
||||||
|
"maxResults": 0
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-find-built-in --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-find-built-in --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `name` | `string` | No | The name of the asset to filter by. |
|
||||||
|
| `type` | `any` | No | The type of the asset to filter by. |
|
||||||
|
| `maxResults` | `integer` | No | Maximum number of assets to return. If the number of found assets exceeds this limit, the result will be truncated. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"$ref": "#/$defs/System.Type"
|
||||||
|
},
|
||||||
|
"maxResults": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(AIGD.AssetObjectRef)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.AssetObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders."
|
||||||
|
},
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(AIGD.AssetObjectRef)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.AssetObjectRef",
|
||||||
|
"description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,138 @@
|
|||||||
|
---
|
||||||
|
name: assets-find
|
||||||
|
description: "Search the Unity asset database using a search filter string. The filter accepts names, labels (`l:`), types (`t:`), AssetBundles (`b:`), areas (`a:`), and globs (`glob:`). See the body for the full filter syntax."
|
||||||
|
---
|
||||||
|
|
||||||
|
# Assets / Find
|
||||||
|
|
||||||
|
Search the asset database using the search filter string. Allows you to search for Assets. The string argument can provide names, labels or types (classnames).
|
||||||
|
|
||||||
|
## Filter syntax
|
||||||
|
|
||||||
|
- **Name** — filter assets by their filename (without extension). Words separated by whitespace are treated as separate name searches.
|
||||||
|
- **Labels (`l:`)** — assets can have labels attached. Use `l:` before each label.
|
||||||
|
- **Types (`t:`)** — find assets based on explicitly identified types. Available types include AnimationClip, AudioClip, AudioMixer, ComputeShader, Font, GUISkin, Material, Mesh, Model, PhysicMaterial, Prefab, Scene, Script, Shader, Sprite, Texture, VideoClip, VisualEffectAsset, VisualEffectSubgraph.
|
||||||
|
- **AssetBundles (`b:`)** — find assets which are part of an Asset bundle.
|
||||||
|
- **Area (`a:`)** — find assets in a specific area. Valid values: `all`, `assets`, `packages`.
|
||||||
|
- **Globbing (`glob:`)** — use globbing to match specific rules.
|
||||||
|
|
||||||
|
Searching is case-insensitive. Use `searchInFolders` to restrict the search scope. `maxResults` caps the returned list (default 10) — results beyond it are truncated.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool assets-find --input '{
|
||||||
|
"filter": "string_value",
|
||||||
|
"searchInFolders": "string_value",
|
||||||
|
"maxResults": 0
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-find --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-find --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `filter` | `string` | No | The filter string can contain search data. Could be empty. Name: Filter assets by their filename (without extension). Words separated by whitespace are treated as separate name searches. Labels (l:): Assets can have labels attached to them. Use 'l:' before each label. Types (t:): Find assets based on explicitly identified types. Use 't:' keyword. Available types: AnimationClip, AudioClip, AudioMixer, ComputeShader, Font, GUISkin, Material, Mesh, Model, PhysicMaterial, Prefab, Scene, Script, Shader, Sprite, Texture, VideoClip, VisualEffectAsset, VisualEffectSubgraph. AssetBundles (b:): Find assets which are part of an Asset bundle. Area (a:): Find assets in a specific area. Valid values are 'all', 'assets', and 'packages'. Globbing (glob:): Use globbing to match specific rules. Note: Searching is case insensitive. |
|
||||||
|
| `searchInFolders` | `any` | No | The folders where the search will start. If null, the search will be performed in all folders. |
|
||||||
|
| `maxResults` | `integer` | No | Maximum number of assets to return. If the number of found assets exceeds this limit, the result will be truncated. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"filter": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"searchInFolders": {
|
||||||
|
"$ref": "#/$defs/System.String-1"
|
||||||
|
},
|
||||||
|
"maxResults": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.String-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(AIGD.AssetObjectRef)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.AssetObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders."
|
||||||
|
},
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(AIGD.AssetObjectRef)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.AssetObjectRef",
|
||||||
|
"description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,194 @@
|
|||||||
|
---
|
||||||
|
name: assets-get-data
|
||||||
|
description: Get asset data from the asset file in the Unity project — every serializable field and property. Supports token-saving path-scoped reads via `paths` or `viewQuery`. Use 'assets-find' to find the asset first.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Assets / Get Data
|
||||||
|
|
||||||
|
Get asset data from the asset file in the Unity project. It includes all serializable fields and properties of the asset. Use 'assets-find' tool to find asset before using this tool.
|
||||||
|
|
||||||
|
## Path-scoped reads (token-saving)
|
||||||
|
|
||||||
|
Supply `paths` (a list of paths) to read only the listed fields/elements via `Reflector.TryReadAt`, or `viewQuery` (a `ViewQuery`) to navigate to a subtree and/or filter by name regex / max depth / type via `Reflector.View`. These two parameters are mutually exclusive — supply at most one. When neither is supplied the full asset is serialized (backwards compatible).
|
||||||
|
|
||||||
|
## Path syntax
|
||||||
|
|
||||||
|
`fieldName`, `nested/field`, `arrayField/[i]`, `dictField/[key]`. Leading `#/` is stripped.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool assets-get-data --input '{
|
||||||
|
"assetRef": "string_value",
|
||||||
|
"paths": "string_value",
|
||||||
|
"viewQuery": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-get-data --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-get-data --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `assetRef` | `any` | Yes | Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders. |
|
||||||
|
| `paths` | `any` | No | Optional. List of paths to read individually via Reflector.TryReadAt. Path syntax: 'fieldName', 'nested/field', 'arrayField/[i]', 'dictField/[key]'. Mutually exclusive with 'viewQuery'. |
|
||||||
|
| `viewQuery` | `any` | No | Optional. View-query filter routed through Reflector.View — combines a starting Path, a case-insensitive NamePattern regex, MaxDepth, and an optional TypeFilter. Mutually exclusive with 'paths'. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"assetRef": {
|
||||||
|
"$ref": "#/$defs/AIGD.AssetObjectRef"
|
||||||
|
},
|
||||||
|
"paths": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(System.String)"
|
||||||
|
},
|
||||||
|
"viewQuery": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.ViewQuery"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.AssetObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders."
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(System.String)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.ViewQuery": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Navigate to this path first, then serialize only that subtree. Path segments are separated by '/'. Use '[i]' for array/list index (e.g. 'users/[2]/name') and '[key]' for dictionary entry (e.g. 'config/[timeout]'). A leading '#/' is stripped automatically. Examples: 'admin/name', 'users/[0]/email', 'config/[timeout]'. Leave null to start from the root object."
|
||||||
|
},
|
||||||
|
"NamePattern": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Case-insensitive .NET regex pattern matched against field and property names. Only branches containing at least one match are kept in the result tree. Examples: 'orbitRadius' (exact name), 'orbit.*' (prefix match), 'radius|speed' (either name). When nothing matches, the root envelope is returned with empty fields/props. Leave null to return all fields and properties without filtering."
|
||||||
|
},
|
||||||
|
"MaxDepth": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Maximum nesting depth of the returned serialized tree. 0 = root type name and value only — no nested fields or properties. 1 = one level of fields/props visible, their children stripped. 2 = two levels visible, and so on. Leave null (default) for unlimited depth."
|
||||||
|
},
|
||||||
|
"TypeFilter": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "When set, prunes the result tree to members whose runtime type is assignable to this type. Non-matching branches are removed; the root envelope is always preserved. Examples: typeof(float) keeps only float fields, typeof(IEnumerable) keeps only collections. Leave null to include members of any type."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"assetRef"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMember": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Object name."
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json."
|
||||||
|
},
|
||||||
|
"fields": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested field value."
|
||||||
|
},
|
||||||
|
"description": "Fields of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
},
|
||||||
|
"props": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested property value."
|
||||||
|
},
|
||||||
|
"description": "Properties of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"typeName"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
---
|
||||||
|
name: assets-material-create
|
||||||
|
description: Create a new Material asset with default parameters at a given 'Assets/'-rooted path ending in '.mat'. Creates intermediate folders if missing. Use 'assets-shader-list-all' to find a valid `shaderName`.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Assets / Create Material
|
||||||
|
|
||||||
|
Create new material asset with default parameters. Creates folders recursively if they do not exist. Provide proper 'shaderName' - use 'assets-shader-list-all' tool to find available shaders.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `assetPath` — must start with `Assets/` and end with `.mat`.
|
||||||
|
- `shaderName` — name resolvable via `UnityEngine.Shader.Find`.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Throws if the path is empty, malformed, or the shader cannot be resolved. Creates a default Material from the resolved shader, saves it, refreshes the AssetDatabase, and returns an `AssetObjectRef` pointing at the new asset.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool assets-material-create --input '{
|
||||||
|
"assetPath": "string_value",
|
||||||
|
"shaderName": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-material-create --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-material-create --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `assetPath` | `string` | Yes | Asset path. Starts with 'Assets/'. Ends with '.mat'. |
|
||||||
|
| `shaderName` | `string` | Yes | Name of the shader that need to be used to create the material. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"shaderName": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"assetPath",
|
||||||
|
"shaderName"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.AssetObjectRef",
|
||||||
|
"description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.AssetObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,209 @@
|
|||||||
|
---
|
||||||
|
name: assets-modify
|
||||||
|
description: Modify an asset file in the project. Use 'assets-get-data' first to inspect the asset structure before modifying. Not allowed to modify asset files in the 'Packages/' folder — modify them in 'Assets/'. Three modification surfaces are available (content, pathPatches, jsonPatch) — see the skill body for details.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Assets / Modify
|
||||||
|
|
||||||
|
## Three modification surfaces
|
||||||
|
|
||||||
|
Use whichever fits the task:
|
||||||
|
|
||||||
|
1. `content` — full `SerializedMember` override (legacy, backwards compatible).
|
||||||
|
2. `pathPatches` — list of `{path, value}` pairs routed through `Reflector.TryModifyAt`.
|
||||||
|
3. `jsonPatch` — JSON Merge Patch routed through `Reflector.TryPatch`.
|
||||||
|
|
||||||
|
When more than one is supplied they run in this order: `jsonPatch` → `pathPatches` → `content`. At least one is required.
|
||||||
|
|
||||||
|
## Path syntax
|
||||||
|
|
||||||
|
`fieldName`, `nested/field`, `arrayField/[i]`, `dictField/[key]`. Leading `#/` is stripped.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool assets-modify --input '{
|
||||||
|
"assetRef": "string_value",
|
||||||
|
"content": "string_value",
|
||||||
|
"pathPatches": "string_value",
|
||||||
|
"jsonPatch": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-modify --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-modify --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `assetRef` | `any` | Yes | Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders. |
|
||||||
|
| `content` | `any` | No | Optional. The asset content. It overrides the existing asset content (legacy path). |
|
||||||
|
| `pathPatches` | `any` | No | Optional. List of path-scoped patches routed through Reflector.TryModifyAt. |
|
||||||
|
| `jsonPatch` | `any` | No | Optional. JSON Merge Patch (RFC 7396, extended with [i]/[key] keys) routed through Reflector.TryPatch. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"assetRef": {
|
||||||
|
"$ref": "#/$defs/AIGD.AssetObjectRef"
|
||||||
|
},
|
||||||
|
"content": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember"
|
||||||
|
},
|
||||||
|
"pathPatches": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(AIGD.PathPatch)"
|
||||||
|
},
|
||||||
|
"jsonPatch": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.AssetObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders."
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMember": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Object name."
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json."
|
||||||
|
},
|
||||||
|
"fields": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested field value."
|
||||||
|
},
|
||||||
|
"description": "Fields of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
},
|
||||||
|
"props": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested property value."
|
||||||
|
},
|
||||||
|
"description": "Properties of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"typeName"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"AIGD.PathPatch": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Slash-delimited path to the target field/element/entry. Plain segment navigates a field or property (e.g. 'admin' or 'admin/name'). Use '[i]' for array/list index (e.g. 'planets/[0]/orbitRadius'). Use '[key]' for dictionary entry (e.g. 'config/[timeout]'). A leading '#/' is stripped automatically. Required."
|
||||||
|
},
|
||||||
|
"Value": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "The new value to write at the path. Use the standard SerializedMember envelope: 'typeName' + 'value' for primitives, or nested 'fields'/'props' for complex types. Required — omitting it overwrites the target with a default empty SerializedMember."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(AIGD.PathPatch)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.PathPatch"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"assetRef"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/System.String-1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.String-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
---
|
||||||
|
name: assets-move
|
||||||
|
description: Move or rename assets at the given project paths. Refreshes the AssetDatabase at the end. Use 'assets-find' to locate the assets first.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Assets / Move
|
||||||
|
|
||||||
|
Move the assets at paths in the project. Should be used for asset rename. Does AssetDatabase.Refresh() at the end. Use 'assets-find' tool to find assets before moving.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `sourcePaths` — paths of the assets to move.
|
||||||
|
- `destinationPaths` — target paths (must match `sourcePaths` length).
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Each pair is moved independently via `AssetDatabase.MoveAsset`. Per-pair failures (Unity's `MoveAsset` returns a non-empty error string) are surfaced in `response.Errors`; successful moves accumulate into `response.MovedPaths`.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool assets-move --input '{
|
||||||
|
"sourcePaths": "string_value",
|
||||||
|
"destinationPaths": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-move --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-move --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `sourcePaths` | `any` | Yes | The paths of the assets to move. |
|
||||||
|
| `destinationPaths` | `any` | Yes | The paths of moved assets. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"sourcePaths": {
|
||||||
|
"$ref": "#/$defs/System.String-1"
|
||||||
|
},
|
||||||
|
"destinationPaths": {
|
||||||
|
"$ref": "#/$defs/System.String-1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.String-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"sourcePaths",
|
||||||
|
"destinationPaths"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.MoveAssetsResponse"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Collections.Generic.List(System.String)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.MoveAssetsResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"MovedPaths": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(System.String)",
|
||||||
|
"description": "List of destination paths of successfully moved assets."
|
||||||
|
},
|
||||||
|
"Errors": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(System.String)",
|
||||||
|
"description": "List of errors encountered during move operations."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,111 @@
|
|||||||
|
---
|
||||||
|
name: assets-prefab-close
|
||||||
|
description: Close the currently opened prefab edit stage. Optionally saves changes back to the prefab asset before closing. Pair with 'assets-prefab-open' to enter the edit mode first.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Assets / Prefab / Close
|
||||||
|
|
||||||
|
Close currently opened prefab. Use it when you are in prefab editing mode in Unity Editor. Use 'assets-prefab-open' tool to open a prefab first.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `save` (default `true`) — when `true`, calls `PrefabUtility.SaveAsPrefabAsset` before exiting the stage; when `false`, the save is skipped. The prefab stage's dirtiness is always cleared at the end, so any unsaved changes are discarded when `save` is `false`.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Throws when no prefab stage is currently open. Returns an `AssetObjectRef` for the closed prefab asset.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool assets-prefab-close --input '{
|
||||||
|
"save": false
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-prefab-close --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-prefab-close --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `save` | `boolean` | No | True to save prefab. False to discard changes. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"save": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.AssetObjectRef",
|
||||||
|
"description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.AssetObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,170 @@
|
|||||||
|
---
|
||||||
|
name: assets-prefab-create
|
||||||
|
description: Create a Prefab (or Prefab Variant) at a project asset path. Source can be a scene GameObject (`gameObjectRef`) or an existing prefab asset (`sourcePrefabAssetPath`). Creates intermediate folders if missing. Use 'gameobject-find' to locate the source GameObject first.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Assets / Prefab / Create
|
||||||
|
|
||||||
|
Create a prefab from a GameObject in the current active scene. The prefab will be saved in the project assets at the specified path. Creates folders recursively if they do not exist. If the source GameObject is already a prefab instance and 'connectGameObjectToPrefab' is true, a Prefab Variant is created automatically. To create a Prefab Variant from an existing prefab asset, provide 'sourcePrefabAssetPath' instead of 'gameObjectRef'. Use 'gameobject-find' tool to find the target GameObject first.
|
||||||
|
|
||||||
|
## Inputs (mutually exclusive sources)
|
||||||
|
|
||||||
|
- `prefabAssetPath` — required. Must start with `Assets/` and end with `.prefab`.
|
||||||
|
- `gameObjectRef` — scene GameObject to convert (or to seed a Prefab Variant from when it is already a prefab instance).
|
||||||
|
- `sourcePrefabAssetPath` — existing prefab asset to seed a Prefab Variant from. Cannot be combined with `gameObjectRef`.
|
||||||
|
- `connectGameObjectToPrefab` (default `true`) — when sourcing from a scene GameObject, connect the scene object to the new prefab asset (becoming a prefab instance). Ignored for `sourcePrefabAssetPath` (always creates a variant).
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Creates intermediate folders along `prefabAssetPath` if they don't already exist. Returns an `AssetObjectRef` pointing at the new prefab asset.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool assets-prefab-create --input '{
|
||||||
|
"prefabAssetPath": "string_value",
|
||||||
|
"gameObjectRef": "string_value",
|
||||||
|
"sourcePrefabAssetPath": "string_value",
|
||||||
|
"connectGameObjectToPrefab": false
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-prefab-create --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-prefab-create --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `prefabAssetPath` | `string` | Yes | Prefab asset path. Should be in the format 'Assets/Path/To/Prefab.prefab'. |
|
||||||
|
| `gameObjectRef` | `any` | No | Reference to a scene GameObject to create the prefab from. If the GameObject is already a prefab instance, a Prefab Variant is created when 'connectGameObjectToPrefab' is true. Optional if 'sourcePrefabAssetPath' is provided. |
|
||||||
|
| `sourcePrefabAssetPath` | `string` | No | Path to an existing prefab asset to create a Prefab Variant from (e.g. 'Assets/Prefabs/Base.prefab'). When provided, a temporary instance is created, saved as a Prefab Variant, and cleaned up. Optional if 'gameObjectRef' is provided. |
|
||||||
|
| `connectGameObjectToPrefab` | `boolean` | No | If true, the scene GameObject will be connected to the new prefab (becoming a prefab instance). If the source is already a prefab instance, this creates a Prefab Variant. If false, the prefab asset is created but the scene GameObject remains unchanged. Ignored when 'sourcePrefabAssetPath' is used (always creates a variant). |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"prefabAssetPath": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"gameObjectRef": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef"
|
||||||
|
},
|
||||||
|
"sourcePrefabAssetPath": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"connectGameObjectToPrefab": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.GameObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of a GameObject in hierarchy. Priority: 3."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"prefabAssetPath"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.AssetObjectRef",
|
||||||
|
"description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.AssetObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,169 @@
|
|||||||
|
---
|
||||||
|
name: assets-prefab-instantiate
|
||||||
|
description: Instantiate a prefab into the currently active scene at an optional position/rotation/scale, parented under an optional scene GameObject path. Use 'assets-find' to locate the prefab asset first.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Assets / Prefab / Instantiate
|
||||||
|
|
||||||
|
Instantiates prefab in the current active scene. Use 'assets-find' tool to find prefab assets in the project.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `prefabAssetPath` — project asset path of the prefab to instantiate.
|
||||||
|
- `gameObjectPath` — destination path in the scene; the last segment becomes the new GameObject's name, any prefix is looked up as the parent (must already exist).
|
||||||
|
- `position` / `rotation` / `scale` — optional transform; default to zero / zero / one.
|
||||||
|
- `isLocalSpace` — when `true`, applies the transform in local space relative to the parent.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool assets-prefab-instantiate --input '{
|
||||||
|
"prefabAssetPath": "string_value",
|
||||||
|
"gameObjectPath": "string_value",
|
||||||
|
"position": "string_value",
|
||||||
|
"rotation": "string_value",
|
||||||
|
"scale": "string_value",
|
||||||
|
"isLocalSpace": false
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-prefab-instantiate --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-prefab-instantiate --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `prefabAssetPath` | `string` | Yes | Prefab asset path. |
|
||||||
|
| `gameObjectPath` | `string` | Yes | GameObject path in the current active scene. |
|
||||||
|
| `position` | `any` | No | Transform position of the GameObject. |
|
||||||
|
| `rotation` | `any` | No | Transform rotation of the GameObject. Euler angles in degrees. |
|
||||||
|
| `scale` | `any` | No | Transform scale of the GameObject. |
|
||||||
|
| `isLocalSpace` | `boolean` | No | World or Local space of transform. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"prefabAssetPath": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"gameObjectPath": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"position": {
|
||||||
|
"$ref": "#/$defs/UnityEngine.Vector3"
|
||||||
|
},
|
||||||
|
"rotation": {
|
||||||
|
"$ref": "#/$defs/UnityEngine.Vector3"
|
||||||
|
},
|
||||||
|
"scale": {
|
||||||
|
"$ref": "#/$defs/UnityEngine.Vector3"
|
||||||
|
},
|
||||||
|
"isLocalSpace": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"UnityEngine.Vector3": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"x": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"y": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"z": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"x",
|
||||||
|
"y",
|
||||||
|
"z"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"prefabAssetPath",
|
||||||
|
"gameObjectPath"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef",
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.GameObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of a GameObject in hierarchy. Priority: 3."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
---
|
||||||
|
name: assets-prefab-open
|
||||||
|
description: Open the prefab edit stage for a prefab instance or prefab asset GameObject. Modifications inside the edit stage propagate to all instances. Pair with 'assets-prefab-close' to exit the stage when done.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Assets / Prefab / Open
|
||||||
|
|
||||||
|
Open prefab edit mode for a specific GameObject. In the Edit mode you can modify the prefab. The modification will be applied to all instances of the prefab across the project. Note: Please use 'assets-prefab-close' tool later to exit prefab editing mode.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `gameObjectRef` — reference to a scene prefab instance OR a prefab asset GameObject. The tool resolves the prefab asset path via `PrefabUtility.GetPrefabAssetPathOfNearestInstanceRoot` and opens the appropriate prefab stage.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Asset-side GameObjects open via the simple `OpenPrefab(path)` overload. Scene-instance GameObjects open via `OpenPrefab(path, gameObject)` so the editor remembers which instance prompted the edit. Editor windows are repainted before returning. Throws when the GameObject cannot be resolved or the stage fails to open.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool assets-prefab-open --input '{
|
||||||
|
"gameObjectRef": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-prefab-open --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-prefab-open --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `gameObjectRef` | `any` | Yes | GameObject that represents prefab instance of an original prefab GameObject. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"gameObjectRef": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.GameObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of a GameObject in hierarchy. Priority: 3."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"gameObjectRef"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
This tool does not return structured output.
|
||||||
|
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
---
|
||||||
|
name: assets-prefab-save
|
||||||
|
description: Save the currently opened prefab edit stage back to its prefab asset without exiting the stage. Pair with 'assets-prefab-open' to enter the edit mode first.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Assets / Prefab / Save
|
||||||
|
|
||||||
|
Save a prefab. Use it when you are in prefab editing mode in Unity Editor. Use 'assets-prefab-open' tool to open a prefab first.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Calls `PrefabUtility.SaveAsPrefabAsset` on the current prefab stage's contents root, clears the stage's dirtiness flag, repaints editor windows, and returns an `AssetObjectRef` to the saved prefab. Throws when no prefab stage is currently open.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool assets-prefab-save --input '{
|
||||||
|
"nothing": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-prefab-save --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-prefab-save --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `nothing` | `string` | No | |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"nothing": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.AssetObjectRef",
|
||||||
|
"description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.AssetObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
---
|
||||||
|
name: assets-refresh
|
||||||
|
description: Refresh the Unity AssetDatabase. Use after files were added or updated outside of the Unity API, or to force script recompilation when a '.cs' file changed. Returns a processing/success response and waits for compilation when triggered.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Assets / Refresh
|
||||||
|
|
||||||
|
Refreshes the AssetDatabase. Use it if any file was added or updated in the project outside of Unity API. Use it if need to force scripts recompilation when '.cs' file changed.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `options` — `ImportAssetOptions` flag (default `ForceSynchronousImport`).
|
||||||
|
- `requestId` — required for processing-mode responses; the tool returns `Processing` immediately and delivers a follow-up completion when compilation finishes.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Runs `AssetDatabase.Refresh(options)`. If `EditorApplication.isCompiling` is true after the refresh, schedules a post-compilation notification and returns a `Processing` response. If compilation already failed (`EditorUtility.scriptCompilationFailed`), returns `Success` with the compilation error details. Otherwise returns a plain `Success`.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool assets-refresh --input '{
|
||||||
|
"options": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-refresh --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-refresh --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `options` | `any` | No | Asset import options. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"options": {
|
||||||
|
"$ref": "#/$defs/UnityEditor.ImportAssetOptions"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"UnityEditor.ImportAssetOptions": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"Default",
|
||||||
|
"ForceUpdate",
|
||||||
|
"ForceSynchronousImport",
|
||||||
|
"ImportRecursive",
|
||||||
|
"DontDownloadFromCacheServer",
|
||||||
|
"ForceUncompressedImport"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
This tool does not return structured output.
|
||||||
|
|
||||||
@@ -0,0 +1,451 @@
|
|||||||
|
---
|
||||||
|
name: assets-shader-get-data
|
||||||
|
description: "Get detailed data about a shader asset — properties, subshaders, passes, compilation messages, and supported status. Supports token-saving path-scoped reads via `paths` or `viewQuery`. Use 'assets-find' with `t:Shader` or 'assets-shader-list-all' to locate the shader first."
|
||||||
|
---
|
||||||
|
|
||||||
|
# Assets / Shader / Get Data
|
||||||
|
|
||||||
|
Get detailed data about a shader asset in the Unity project. Returns shader properties, subshaders, passes, compilation errors, and supported status. Use 'assets-find' tool with filter 't:Shader' to find shaders, or 'assets-shader-list-all' tool to list all shader names.
|
||||||
|
|
||||||
|
## Toggles (most default off to keep responses small)
|
||||||
|
|
||||||
|
- `includeMessages` (default `true`) — shader compilation messages.
|
||||||
|
- `includeProperties` (default `false`) — uniforms list.
|
||||||
|
- `includeSubshaders` (default `false`) — subshader and pass structure.
|
||||||
|
- `includeSourceCode` (default `false`) — pass source code. Implies `includeSubshaders` and can produce very large responses.
|
||||||
|
|
||||||
|
## Path-scoped reads (token-saving)
|
||||||
|
|
||||||
|
Supply `paths` (a list of paths) to read only the listed fields/elements via `Reflector.TryReadAt`, or `viewQuery` (a `ViewQuery`) to navigate to a subtree and/or filter by name regex / max depth / type via `Reflector.View`. The result populates `View` on the returned `ShaderData`. These two parameters are mutually exclusive.
|
||||||
|
|
||||||
|
## Path syntax
|
||||||
|
|
||||||
|
`fieldName`, `nested/field`, `arrayField/[i]`, `dictField/[key]`. Leading `#/` is stripped.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool assets-shader-get-data --input '{
|
||||||
|
"assetRef": "string_value",
|
||||||
|
"includeMessages": "string_value",
|
||||||
|
"includeProperties": "string_value",
|
||||||
|
"includeSubshaders": "string_value",
|
||||||
|
"includeSourceCode": "string_value",
|
||||||
|
"paths": "string_value",
|
||||||
|
"viewQuery": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-shader-get-data --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-shader-get-data --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `assetRef` | `any` | Yes | Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders. |
|
||||||
|
| `includeMessages` | `any` | No | Include compilation error and warning messages. Default: true |
|
||||||
|
| `includeProperties` | `any` | No | Include shader properties (uniforms) list. Default: false |
|
||||||
|
| `includeSubshaders` | `any` | No | Include subshader and pass structure. Default: false |
|
||||||
|
| `includeSourceCode` | `any` | No | Include pass source code in subshader data. Requires 'includeSubshaders' to be true. Can produce very large responses. Default: false |
|
||||||
|
| `paths` | `any` | No | Optional. List of paths to read individually via Reflector.TryReadAt against the underlying Shader asset. Path syntax: 'fieldName', 'nested/field', 'arrayField/[i]', 'dictField/[key]'. Mutually exclusive with 'viewQuery'. |
|
||||||
|
| `viewQuery` | `any` | No | Optional. View-query filter routed through Reflector.View against the underlying Shader asset. Mutually exclusive with 'paths'. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"assetRef": {
|
||||||
|
"$ref": "#/$defs/AIGD.AssetObjectRef"
|
||||||
|
},
|
||||||
|
"includeMessages": {
|
||||||
|
"$ref": "#/$defs/System.Boolean"
|
||||||
|
},
|
||||||
|
"includeProperties": {
|
||||||
|
"$ref": "#/$defs/System.Boolean"
|
||||||
|
},
|
||||||
|
"includeSubshaders": {
|
||||||
|
"$ref": "#/$defs/System.Boolean"
|
||||||
|
},
|
||||||
|
"includeSourceCode": {
|
||||||
|
"$ref": "#/$defs/System.Boolean"
|
||||||
|
},
|
||||||
|
"paths": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(System.String)"
|
||||||
|
},
|
||||||
|
"viewQuery": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.ViewQuery"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.AssetObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders."
|
||||||
|
},
|
||||||
|
"System.Boolean": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(System.String)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.ViewQuery": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Navigate to this path first, then serialize only that subtree. Path segments are separated by '/'. Use '[i]' for array/list index (e.g. 'users/[2]/name') and '[key]' for dictionary entry (e.g. 'config/[timeout]'). A leading '#/' is stripped automatically. Examples: 'admin/name', 'users/[0]/email', 'config/[timeout]'. Leave null to start from the root object."
|
||||||
|
},
|
||||||
|
"NamePattern": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Case-insensitive .NET regex pattern matched against field and property names. Only branches containing at least one match are kept in the result tree. Examples: 'orbitRadius' (exact name), 'orbit.*' (prefix match), 'radius|speed' (either name). When nothing matches, the root envelope is returned with empty fields/props. Leave null to return all fields and properties without filtering."
|
||||||
|
},
|
||||||
|
"MaxDepth": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Maximum nesting depth of the returned serialized tree. 0 = root type name and value only — no nested fields or properties. 1 = one level of fields/props visible, their children stripped. 2 = two levels visible, and so on. Leave null (default) for unlimited depth."
|
||||||
|
},
|
||||||
|
"TypeFilter": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "When set, prunes the result tree to members whose runtime type is assignable to this type. Non-matching branches are removed; the root envelope is always preserved. Examples: typeof(float) keeps only float fields, typeof(IEnumerable) keeps only collections. Leave null to include members of any type."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"assetRef"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.ShaderData"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.AssetObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders."
|
||||||
|
},
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(AIGD.ShaderMessageData)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.ShaderMessageData"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.ShaderMessageData": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Message": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The error or warning message text."
|
||||||
|
},
|
||||||
|
"Line": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "The line number in the shader source where the issue occurs."
|
||||||
|
},
|
||||||
|
"Severity": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Severity level (e.g. 'Error', 'Warning')."
|
||||||
|
},
|
||||||
|
"Platform": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The platform on which the error occurs (e.g. 'OpenGLCore', 'D3D11')."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"Line"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(AIGD.ShaderPropertyData)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.ShaderPropertyData"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.ShaderPropertyData": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Property name as used in shader code (e.g. '_MainTex', '_Color')."
|
||||||
|
},
|
||||||
|
"Description": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Human-readable description/display name of the property."
|
||||||
|
},
|
||||||
|
"Type": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Property type (e.g. 'Color', 'Float', 'Range', 'Texture', 'Vector', 'Int')."
|
||||||
|
},
|
||||||
|
"Flags": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Property flags (e.g. 'None', 'HideInInspector', 'PerRendererData')."
|
||||||
|
},
|
||||||
|
"NameId": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "The unique name ID for this property."
|
||||||
|
},
|
||||||
|
"RangeMin": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Minimum value for Range properties. Null for non-range properties."
|
||||||
|
},
|
||||||
|
"RangeMax": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Maximum value for Range properties. Null for non-range properties."
|
||||||
|
},
|
||||||
|
"DefaultTextureName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Default texture name for Texture properties. Null if not applicable."
|
||||||
|
},
|
||||||
|
"Attributes": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(System.String)",
|
||||||
|
"description": "Custom attributes applied to this property. Null if none."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"NameId"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(System.String)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(AIGD.SubshaderData)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.SubshaderData"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.SubshaderData": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Index": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Index of this subshader within the shader."
|
||||||
|
},
|
||||||
|
"PassCount": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Number of passes in this subshader."
|
||||||
|
},
|
||||||
|
"Passes": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(AIGD.PassData)",
|
||||||
|
"description": "List of passes in this subshader. Null if no passes."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"Index",
|
||||||
|
"PassCount"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(AIGD.PassData)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.PassData"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.PassData": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Index": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Index of this pass within the subshader."
|
||||||
|
},
|
||||||
|
"Name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of the pass. Null if unnamed."
|
||||||
|
},
|
||||||
|
"SourceCode": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Source code of the pass. Null if unavailable."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"Index"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMember": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Object name."
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json."
|
||||||
|
},
|
||||||
|
"fields": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested field value."
|
||||||
|
},
|
||||||
|
"description": "Fields of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
},
|
||||||
|
"props": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested property value."
|
||||||
|
},
|
||||||
|
"description": "Properties of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"typeName"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.ShaderData": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Reference": {
|
||||||
|
"$ref": "#/$defs/AIGD.AssetObjectRef",
|
||||||
|
"description": "Reference to the shader asset for future operations."
|
||||||
|
},
|
||||||
|
"Name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Full name of the shader (e.g. 'Standard', 'Universal Render Pipeline/Lit')."
|
||||||
|
},
|
||||||
|
"IsSupported": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether the shader is supported on the current GPU and platform."
|
||||||
|
},
|
||||||
|
"RenderQueue": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "The render queue value of the shader."
|
||||||
|
},
|
||||||
|
"HasErrors": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether the shader has any compilation errors."
|
||||||
|
},
|
||||||
|
"PropertyCount": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Number of properties exposed by the shader."
|
||||||
|
},
|
||||||
|
"PassCount": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Total number of passes in the shader."
|
||||||
|
},
|
||||||
|
"RenderType": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The RenderType tag value from the first pass, if set."
|
||||||
|
},
|
||||||
|
"Messages": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(AIGD.ShaderMessageData)",
|
||||||
|
"description": "Compilation messages including errors and warnings. Null if no messages."
|
||||||
|
},
|
||||||
|
"Properties": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(AIGD.ShaderPropertyData)",
|
||||||
|
"description": "List of shader properties (uniforms). Null if the shader has no properties."
|
||||||
|
},
|
||||||
|
"Subshaders": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(AIGD.SubshaderData)",
|
||||||
|
"description": "List of subshaders with their passes. Null if shader data is unavailable."
|
||||||
|
},
|
||||||
|
"View": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Path-scoped read or view-query result, populated when 'paths' or 'viewQuery' is supplied. Null otherwise."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"IsSupported",
|
||||||
|
"RenderQueue",
|
||||||
|
"HasErrors",
|
||||||
|
"PropertyCount",
|
||||||
|
"PassCount"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
---
|
||||||
|
name: assets-shader-list-all
|
||||||
|
description: List all shaders available in the project assets and packages, sorted by name. Use this to discover a valid `shaderName` for 'assets-material-create'.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Assets / List Shaders
|
||||||
|
|
||||||
|
List all available shaders in the project assets and packages. Returns their names. Use this to find a shader name for 'assets-material-create' tool.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Enumerates shaders via `ShaderUtils.GetAllShaders`, filters out nulls, and returns the names alphabetically sorted.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool assets-shader-list-all --input '{
|
||||||
|
"nothing": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-shader-list-all --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool assets-shader-list-all --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `nothing` | `string` | No | |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"nothing": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/System.String-1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.String-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
---
|
||||||
|
name: console-clear-logs
|
||||||
|
description: Clear the MCP log cache (used by 'console-get-logs') and the Unity Editor Console window. Useful for isolating logs to a specific action by clearing the slate first.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Console / Clear Logs
|
||||||
|
|
||||||
|
Clears the MCP log cache (used by console-get-logs) and the Unity Editor Console window. Useful for isolating errors related to a specific action by clearing logs before performing the action.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Calls `Debug.ClearDeveloperConsole()` to wipe the Editor Console, then clears the MCP-side `LogCollector` cache so subsequent 'console-get-logs' calls only see new entries.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool console-clear-logs --input '{
|
||||||
|
"nothing": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool console-clear-logs --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool console-clear-logs --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `nothing` | `string` | No | |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"nothing": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
This tool does not return structured output.
|
||||||
|
|
||||||
@@ -0,0 +1,143 @@
|
|||||||
|
---
|
||||||
|
name: console-get-logs
|
||||||
|
description: Retrieve Unity Editor logs from the MCP plugin's `LogCollector`, optionally filtered by log type or time window. Useful for debugging and monitoring Editor activity.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Console / Get Logs
|
||||||
|
|
||||||
|
Retrieves Unity Editor logs. Useful for debugging and monitoring Unity Editor activity.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `maxEntries` (default 100, minimum 1) — caps the size of the returned array.
|
||||||
|
- `logTypeFilter` — Unity `LogType` filter; `null` returns all severities.
|
||||||
|
- `includeStackTrace` (default `false`) — include stack-trace strings in each entry.
|
||||||
|
- `lastMinutes` (default 0) — when non-zero, only logs from the last N minutes are returned.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool console-get-logs --input '{
|
||||||
|
"maxEntries": 0,
|
||||||
|
"logTypeFilter": "string_value",
|
||||||
|
"includeStackTrace": false,
|
||||||
|
"lastMinutes": 0
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool console-get-logs --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool console-get-logs --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `maxEntries` | `integer` | No | Maximum number of log entries to return. Minimum: 1. Default: 100 |
|
||||||
|
| `logTypeFilter` | `any` | No | Filter by log type. 'null' means All. |
|
||||||
|
| `includeStackTrace` | `boolean` | No | Include stack traces in the output. Default: false |
|
||||||
|
| `lastMinutes` | `integer` | No | Return logs from the last N minutes. If 0, returns all available logs. Default: 0 |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"maxEntries": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"logTypeFilter": {
|
||||||
|
"$ref": "#/$defs/UnityEngine.LogType"
|
||||||
|
},
|
||||||
|
"includeStackTrace": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"lastMinutes": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"UnityEngine.LogType": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"Error",
|
||||||
|
"Assert",
|
||||||
|
"Warning",
|
||||||
|
"Log",
|
||||||
|
"Exception"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.Unity.MCP.LogEntry-1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"com.IvanMurzak.Unity.MCP.LogEntry": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"LogType": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"Error",
|
||||||
|
"Assert",
|
||||||
|
"Warning",
|
||||||
|
"Log",
|
||||||
|
"Exception"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Message": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"Timestamp": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "date-time"
|
||||||
|
},
|
||||||
|
"StackTrace": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"LogType",
|
||||||
|
"Timestamp"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.Unity.MCP.LogEntry-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.Unity.MCP.LogEntry"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,125 @@
|
|||||||
|
---
|
||||||
|
name: editor-application-get-state
|
||||||
|
description: Return the current state of `UnityEditor.EditorApplication` — playmode, paused state, compilation state, and related flags.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Editor / Application / Get State
|
||||||
|
|
||||||
|
Returns available information about 'UnityEditor.EditorApplication'. Use it to get information about the current state of the Unity Editor application. Such as: playmode, paused state, compilation state, etc.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Snapshots Editor state via `EditorStatsData.FromEditor()` on the main thread and returns the result.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool editor-application-get-state --input '{
|
||||||
|
"nothing": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool editor-application-get-state --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool editor-application-get-state --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `nothing` | `string` | No | |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"nothing": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.EditorStatsData",
|
||||||
|
"description": "Available information about 'UnityEditor.EditorApplication'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.EditorStatsData": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"IsPlaying": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether the Editor is in Play mode."
|
||||||
|
},
|
||||||
|
"IsPaused": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether the Editor is paused."
|
||||||
|
},
|
||||||
|
"IsCompiling": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Is editor currently compiling scripts? (Read Only)"
|
||||||
|
},
|
||||||
|
"IsPlayingOrWillChangePlaymode": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Editor application state which is true only when the Editor is currently in or about to enter Play mode. (Read Only)"
|
||||||
|
},
|
||||||
|
"IsUpdating": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "True if the Editor is currently refreshing the AssetDatabase. (Read Only)"
|
||||||
|
},
|
||||||
|
"ApplicationContentsPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the Unity editor contents folder. (Read Only)"
|
||||||
|
},
|
||||||
|
"ApplicationPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Gets the path to the Unity Editor application. (Read Only)"
|
||||||
|
},
|
||||||
|
"TimeSinceStartup": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "The time since the editor was started. (Read Only)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"IsPlaying",
|
||||||
|
"IsPaused",
|
||||||
|
"IsCompiling",
|
||||||
|
"IsPlayingOrWillChangePlaymode",
|
||||||
|
"IsUpdating",
|
||||||
|
"TimeSinceStartup"
|
||||||
|
],
|
||||||
|
"description": "Available information about 'UnityEditor.EditorApplication'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,135 @@
|
|||||||
|
---
|
||||||
|
name: editor-application-set-state
|
||||||
|
description: Start / stop / pause the Unity Editor 'playmode'. Use 'editor-application-get-state' to inspect the current state first. Throws if the project currently has compilation errors.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Editor / Application / Set State
|
||||||
|
|
||||||
|
Control the Unity Editor application state. You can start, stop, or pause the 'playmode'. Use 'editor-application-get-state' tool to get the current state first.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `isPlaying` (default `false`) — sets `EditorApplication.isPlaying`.
|
||||||
|
- `isPaused` (default `false`) — sets `EditorApplication.isPaused`.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Refuses any state change while `EditorUtility.scriptCompilationFailed` is true — instead throws with the compilation error details so the caller can fix them first. On success returns the post-change `EditorStatsData` snapshot.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool editor-application-set-state --input '{
|
||||||
|
"isPlaying": false,
|
||||||
|
"isPaused": false
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool editor-application-set-state --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool editor-application-set-state --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `isPlaying` | `boolean` | No | If true, the 'playmode' will be started. If false, the 'playmode' will be stopped. |
|
||||||
|
| `isPaused` | `boolean` | No | If true, the 'playmode' will be paused. If false, the 'playmode' will be resumed. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"isPlaying": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"isPaused": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.EditorStatsData",
|
||||||
|
"description": "Available information about 'UnityEditor.EditorApplication'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.EditorStatsData": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"IsPlaying": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether the Editor is in Play mode."
|
||||||
|
},
|
||||||
|
"IsPaused": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether the Editor is paused."
|
||||||
|
},
|
||||||
|
"IsCompiling": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Is editor currently compiling scripts? (Read Only)"
|
||||||
|
},
|
||||||
|
"IsPlayingOrWillChangePlaymode": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Editor application state which is true only when the Editor is currently in or about to enter Play mode. (Read Only)"
|
||||||
|
},
|
||||||
|
"IsUpdating": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "True if the Editor is currently refreshing the AssetDatabase. (Read Only)"
|
||||||
|
},
|
||||||
|
"ApplicationContentsPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the Unity editor contents folder. (Read Only)"
|
||||||
|
},
|
||||||
|
"ApplicationPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Gets the path to the Unity Editor application. (Read Only)"
|
||||||
|
},
|
||||||
|
"TimeSinceStartup": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "The time since the editor was started. (Read Only)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"IsPlaying",
|
||||||
|
"IsPaused",
|
||||||
|
"IsCompiling",
|
||||||
|
"IsPlayingOrWillChangePlaymode",
|
||||||
|
"IsUpdating",
|
||||||
|
"TimeSinceStartup"
|
||||||
|
],
|
||||||
|
"description": "Available information about 'UnityEditor.EditorApplication'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,247 @@
|
|||||||
|
---
|
||||||
|
name: editor-selection-get
|
||||||
|
description: Get information about the current Selection in the Unity Editor — active object, active transform, selected GameObjects, transforms, instance IDs, and asset GUIDs (each enrichment is opt-in). Pair with 'editor-selection-set' to change the selection.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Editor / Selection / Get
|
||||||
|
|
||||||
|
Get information about the current Selection in the Unity Editor. Use 'editor-selection-set' tool to set the selection.
|
||||||
|
|
||||||
|
## Toggles (default off where indicated to keep responses small)
|
||||||
|
|
||||||
|
- `includeGameObjects` (default `false`) — populate `GameObjects[]`.
|
||||||
|
- `includeTransforms` (default `false`) — populate `Transforms[]` as `ComponentRef`s.
|
||||||
|
- `includeInstanceIDs` (default `false`) — populate `InstanceIDs[]`.
|
||||||
|
- `includeAssetGUIDs` (default `false`) — populate `AssetGUIDs[]` from project-window selection.
|
||||||
|
- `includeActiveObject` (default `true`) — populate `ActiveObject` as a generic `ObjectRef`.
|
||||||
|
- `includeActiveTransform` (default `true`) — populate `ActiveTransform` as a `ComponentRef`.
|
||||||
|
|
||||||
|
`ActiveGameObject` and `ActiveInstanceID` are always populated.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool editor-selection-get --input '{
|
||||||
|
"includeGameObjects": false,
|
||||||
|
"includeTransforms": false,
|
||||||
|
"includeInstanceIDs": false,
|
||||||
|
"includeAssetGUIDs": false,
|
||||||
|
"includeActiveObject": false,
|
||||||
|
"includeActiveTransform": false
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool editor-selection-get --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool editor-selection-get --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `includeGameObjects` | `boolean` | No | |
|
||||||
|
| `includeTransforms` | `boolean` | No | |
|
||||||
|
| `includeInstanceIDs` | `boolean` | No | |
|
||||||
|
| `includeAssetGUIDs` | `boolean` | No | |
|
||||||
|
| `includeActiveObject` | `boolean` | No | |
|
||||||
|
| `includeActiveTransform` | `boolean` | No | |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"includeGameObjects": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"includeTransforms": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"includeInstanceIDs": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"includeAssetGUIDs": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"includeActiveObject": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"includeActiveTransform": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.SelectionData"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.GameObjectRef-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef",
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.GameObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of a GameObject in hierarchy. Priority: 3."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
},
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.ComponentRef-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.ComponentRef",
|
||||||
|
"description": "Component reference. Used to find a Component at GameObject."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.ComponentRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"index": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1."
|
||||||
|
},
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null."
|
||||||
|
},
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"index",
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Component reference. Used to find a Component at GameObject."
|
||||||
|
},
|
||||||
|
"System.Int32-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.String-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.ObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Reference to UnityEngine.Object instance. It could be GameObject, Component, Asset, etc. Anything extended from UnityEngine.Object."
|
||||||
|
},
|
||||||
|
"AIGD.SelectionData": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"GameObjects": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef-1",
|
||||||
|
"description": "Returns the actual game object selection. Includes Prefabs, non-modifiable objects."
|
||||||
|
},
|
||||||
|
"Transforms": {
|
||||||
|
"$ref": "#/$defs/AIGD.ComponentRef-1",
|
||||||
|
"description": "Returns the top level selection, excluding Prefabs."
|
||||||
|
},
|
||||||
|
"InstanceIDs": {
|
||||||
|
"$ref": "#/$defs/System.Int32-1",
|
||||||
|
"description": "The actual unfiltered selection from the Scene returned as instance ids instead of objects."
|
||||||
|
},
|
||||||
|
"AssetGUIDs": {
|
||||||
|
"$ref": "#/$defs/System.String-1",
|
||||||
|
"description": "Returns the guids of the selected assets."
|
||||||
|
},
|
||||||
|
"ActiveGameObject": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef",
|
||||||
|
"description": "Returns the active game object. (The one shown in the inspector)."
|
||||||
|
},
|
||||||
|
"ActiveInstanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Returns the instanceID of the actual object selection. Includes Prefabs, non-modifiable objects"
|
||||||
|
},
|
||||||
|
"ActiveObject": {
|
||||||
|
"$ref": "#/$defs/AIGD.ObjectRef",
|
||||||
|
"description": "Returns the actual object selection. Includes Prefabs, non-modifiable objects."
|
||||||
|
},
|
||||||
|
"ActiveTransform": {
|
||||||
|
"$ref": "#/$defs/AIGD.ComponentRef",
|
||||||
|
"description": "Returns the active transform. (The one shown in the inspector)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"ActiveInstanceID"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,244 @@
|
|||||||
|
---
|
||||||
|
name: editor-selection-set
|
||||||
|
description: Set the current Selection in the Unity Editor to the provided objects. All `ObjectRef`s must resolve to existing Unity objects; otherwise the call throws. Use 'editor-selection-get' to inspect the current selection first.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Editor / Selection / Set
|
||||||
|
|
||||||
|
Set the current Selection in the Unity Editor to the provided objects. Use 'editor-selection-get' tool to get the current selection first.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `select` — array of `ObjectRef`. Every entry MUST resolve via `FindObject()`; otherwise the tool throws before touching `Selection.objects`.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Assigns the resolved array to `Selection.objects`, then calls `UnityEditorInternal.InternalEditorUtility.RepaintAllViews()` so Hierarchy/Inspector reflect the change. Returns the post-change `SelectionData` snapshot.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool editor-selection-set --input '{
|
||||||
|
"select": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool editor-selection-set --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool editor-selection-set --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `select` | `any` | Yes | |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"select": {
|
||||||
|
"$ref": "#/$defs/AIGD.ObjectRef-1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.ObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Reference to UnityEngine.Object instance. It could be GameObject, Component, Asset, etc. Anything extended from UnityEngine.Object."
|
||||||
|
},
|
||||||
|
"AIGD.ObjectRef-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.ObjectRef",
|
||||||
|
"description": "Reference to UnityEngine.Object instance. It could be GameObject, Component, Asset, etc. Anything extended from UnityEngine.Object."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"select"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.SelectionData"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.GameObjectRef-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef",
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.GameObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of a GameObject in hierarchy. Priority: 3."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
},
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.ComponentRef-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.ComponentRef",
|
||||||
|
"description": "Component reference. Used to find a Component at GameObject."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.ComponentRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"index": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1."
|
||||||
|
},
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null."
|
||||||
|
},
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"index",
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Component reference. Used to find a Component at GameObject."
|
||||||
|
},
|
||||||
|
"System.Int32-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.String-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.ObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Reference to UnityEngine.Object instance. It could be GameObject, Component, Asset, etc. Anything extended from UnityEngine.Object."
|
||||||
|
},
|
||||||
|
"AIGD.SelectionData": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"GameObjects": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef-1",
|
||||||
|
"description": "Returns the actual game object selection. Includes Prefabs, non-modifiable objects."
|
||||||
|
},
|
||||||
|
"Transforms": {
|
||||||
|
"$ref": "#/$defs/AIGD.ComponentRef-1",
|
||||||
|
"description": "Returns the top level selection, excluding Prefabs."
|
||||||
|
},
|
||||||
|
"InstanceIDs": {
|
||||||
|
"$ref": "#/$defs/System.Int32-1",
|
||||||
|
"description": "The actual unfiltered selection from the Scene returned as instance ids instead of objects."
|
||||||
|
},
|
||||||
|
"AssetGUIDs": {
|
||||||
|
"$ref": "#/$defs/System.String-1",
|
||||||
|
"description": "Returns the guids of the selected assets."
|
||||||
|
},
|
||||||
|
"ActiveGameObject": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef",
|
||||||
|
"description": "Returns the active game object. (The one shown in the inspector)."
|
||||||
|
},
|
||||||
|
"ActiveInstanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Returns the instanceID of the actual object selection. Includes Prefabs, non-modifiable objects"
|
||||||
|
},
|
||||||
|
"ActiveObject": {
|
||||||
|
"$ref": "#/$defs/AIGD.ObjectRef",
|
||||||
|
"description": "Returns the actual object selection. Includes Prefabs, non-modifiable objects."
|
||||||
|
},
|
||||||
|
"ActiveTransform": {
|
||||||
|
"$ref": "#/$defs/AIGD.ComponentRef",
|
||||||
|
"description": "Returns the active transform. (The one shown in the inspector)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"ActiveInstanceID"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,192 @@
|
|||||||
|
---
|
||||||
|
name: gameobject-component-add
|
||||||
|
description: Add one or more Components to a GameObject in the opened Prefab or active Scene. Component types are looked up by full name (with namespace) or by class-name fallback. Use 'gameobject-find' to locate the host GameObject and 'gameobject-component-list-all' to discover valid component type names.
|
||||||
|
---
|
||||||
|
|
||||||
|
# GameObject / Component / Add
|
||||||
|
|
||||||
|
Add Component to GameObject in opened Prefab or in a Scene. Use 'gameobject-find' tool to find the target GameObject first. Use 'gameobject-component-list-all' tool to find the component type names to add.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `componentNames` — list of component type names. Each entry may be a fully-qualified type name (preferred) or a bare class name (resolved via fallback to `AllComponentTypes`).
|
||||||
|
- `gameObjectRef` — the target GameObject. Required.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Per-name errors (unknown type, type not assignable to `UnityEngine.Component`, add-failed/duplicate) are accumulated in `response.Errors` / `response.Warnings` instead of throwing, so a single bad name does not abort the whole batch. Successful additions populate `response.AddedComponents` with `ComponentDataShallow` snapshots.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool gameobject-component-add --input '{
|
||||||
|
"componentNames": "string_value",
|
||||||
|
"gameObjectRef": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool gameobject-component-add --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool gameobject-component-add --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `componentNames` | `any` | Yes | Full name of the Component. It should include full namespace path and the class name. |
|
||||||
|
| `gameObjectRef` | `any` | Yes | Find GameObject in opened Prefab or in the active Scene. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"componentNames": {
|
||||||
|
"$ref": "#/$defs/System.String-1"
|
||||||
|
},
|
||||||
|
"gameObjectRef": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.String-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.GameObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of a GameObject in hierarchy. Priority: 3."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"componentNames",
|
||||||
|
"gameObjectRef"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.AddComponentResponse"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Collections.Generic.List(AIGD.ComponentDataShallow)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.ComponentDataShallow"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.ComponentDataShallow": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"typeName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"isEnabled": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"False",
|
||||||
|
"True",
|
||||||
|
"NA"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID",
|
||||||
|
"isEnabled"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(System.String)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.AddComponentResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"AddedComponents": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(AIGD.ComponentDataShallow)",
|
||||||
|
"description": "List of successfully added components."
|
||||||
|
},
|
||||||
|
"Messages": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(System.String)",
|
||||||
|
"description": "List of success messages for added components."
|
||||||
|
},
|
||||||
|
"Warnings": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(System.String)",
|
||||||
|
"description": "List of warnings encountered during component addition."
|
||||||
|
},
|
||||||
|
"Errors": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(System.String)",
|
||||||
|
"description": "List of errors encountered during component addition."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,199 @@
|
|||||||
|
---
|
||||||
|
name: gameobject-component-destroy
|
||||||
|
description: Destroy one or more Components from a target GameObject. Missing (null) components are skipped — they cannot be destroyed. Use 'gameobject-find' and 'gameobject-component-get' to identify the components first.
|
||||||
|
---
|
||||||
|
|
||||||
|
# GameObject / Component / Destroy
|
||||||
|
|
||||||
|
Destroy one or many components from target GameObject. Can't destroy missed components. Use 'gameobject-find' tool to find the target GameObject and 'gameobject-component-get' to get component details first.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `gameObjectRef` — the host GameObject.
|
||||||
|
- `destroyComponentRefs` — `ComponentRefList` of components to destroy (matched against the GameObject's components).
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Iterates `go.GetComponents<Component>()`, skipping null entries (missing scripts). For each non-null component that matches one of `destroyComponentRefs`, the tool snapshots a `ComponentRef`, calls `Object.DestroyImmediate`, and records the destroyed reference. If no component matches at all, throws with the help text from `Error.NotFoundComponents` (which includes a preview of all available components on the GameObject).
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool gameobject-component-destroy --input '{
|
||||||
|
"gameObjectRef": "string_value",
|
||||||
|
"destroyComponentRefs": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool gameobject-component-destroy --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool gameobject-component-destroy --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `gameObjectRef` | `any` | Yes | Find GameObject in opened Prefab or in the active Scene. |
|
||||||
|
| `destroyComponentRefs` | `any` | Yes | Component reference array. Used to find Component at GameObject. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"gameObjectRef": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef"
|
||||||
|
},
|
||||||
|
"destroyComponentRefs": {
|
||||||
|
"$ref": "#/$defs/AIGD.ComponentRefList"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.GameObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of a GameObject in hierarchy. Priority: 3."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
},
|
||||||
|
"AIGD.ComponentRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"index": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1."
|
||||||
|
},
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null."
|
||||||
|
},
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"index",
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Component reference. Used to find a Component at GameObject."
|
||||||
|
},
|
||||||
|
"AIGD.ComponentRefList": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.ComponentRef",
|
||||||
|
"description": "Component reference. Used to find a Component at GameObject."
|
||||||
|
},
|
||||||
|
"description": "Component reference array. Used to find Component at GameObject."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"gameObjectRef",
|
||||||
|
"destroyComponentRefs"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.DestroyComponentsResponse"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.ComponentRefList": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.ComponentRef",
|
||||||
|
"description": "Component reference. Used to find a Component at GameObject."
|
||||||
|
},
|
||||||
|
"description": "Component reference array. Used to find Component at GameObject."
|
||||||
|
},
|
||||||
|
"AIGD.ComponentRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"index": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1."
|
||||||
|
},
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null."
|
||||||
|
},
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"index",
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Component reference. Used to find a Component at GameObject."
|
||||||
|
},
|
||||||
|
"AIGD.DestroyComponentsResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"DestroyedComponents": {
|
||||||
|
"$ref": "#/$defs/AIGD.ComponentRefList",
|
||||||
|
"description": "List of destroyed components."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,336 @@
|
|||||||
|
---
|
||||||
|
name: gameobject-component-get
|
||||||
|
description: Get detailed information about a specific Component on a GameObject — type, enabled state, and (optionally) serialized fields and properties. Supports token-saving path-scoped reads via `paths` or `viewQuery`. Use 'gameobject-find' to list components first.
|
||||||
|
---
|
||||||
|
|
||||||
|
# GameObject / Component / Get
|
||||||
|
|
||||||
|
Get detailed information about a specific Component on a GameObject. Returns component type, enabled state, and optionally serialized fields and properties. Use this to inspect component data before modifying it. Use 'gameobject-find' tool to get the list of all components on the GameObject.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `gameObjectRef` — the host GameObject.
|
||||||
|
- `componentRef` — the specific component to inspect (matched by index or instance ID).
|
||||||
|
- `includeFields` (default `true`) — populate the legacy `Fields` list.
|
||||||
|
- `includeProperties` (default `true`) — populate the legacy `Properties` list.
|
||||||
|
- `deepSerialization` (default `false`) — when populating legacy lists, recurse into nested members.
|
||||||
|
|
||||||
|
## Path-scoped reads (token-saving)
|
||||||
|
|
||||||
|
Supply `paths` (a list of paths) to read only the listed fields/elements via `Reflector.TryReadAt`, or `viewQuery` (a `ViewQuery`) to navigate to a subtree and/or filter by name regex / max depth / type via `Reflector.View`. The result is returned in the `View` field of the response, and the legacy `Fields`/`Properties` lists are skipped. These two parameters are mutually exclusive — supply at most one.
|
||||||
|
|
||||||
|
## Path syntax
|
||||||
|
|
||||||
|
`fieldName`, `nested/field`, `arrayField/[i]`, `dictField/[key]`. Leading `#/` is stripped.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool gameobject-component-get --input '{
|
||||||
|
"gameObjectRef": "string_value",
|
||||||
|
"componentRef": "string_value",
|
||||||
|
"includeFields": false,
|
||||||
|
"includeProperties": false,
|
||||||
|
"deepSerialization": false,
|
||||||
|
"paths": "string_value",
|
||||||
|
"viewQuery": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool gameobject-component-get --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool gameobject-component-get --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `gameObjectRef` | `any` | Yes | Find GameObject in opened Prefab or in the active Scene. |
|
||||||
|
| `componentRef` | `any` | Yes | Component reference. Used to find a Component at GameObject. |
|
||||||
|
| `includeFields` | `boolean` | No | Include serialized fields of the component. |
|
||||||
|
| `includeProperties` | `boolean` | No | Include serialized properties of the component. |
|
||||||
|
| `deepSerialization` | `boolean` | No | Performs deep serialization including all nested objects. Otherwise, only serializes top-level members. |
|
||||||
|
| `paths` | `any` | No | Optional. List of paths to read individually via Reflector.TryReadAt. When supplied, the legacy 'Fields'/'Properties' lists are skipped and the result is returned in 'View'. Path syntax: 'fieldName', 'nested/field', 'arrayField/[i]', 'dictField/[key]'. Mutually exclusive with 'viewQuery'. |
|
||||||
|
| `viewQuery` | `any` | No | Optional. View-query filter routed through Reflector.View. When supplied, the legacy 'Fields'/'Properties' lists are skipped and the filtered subtree is returned in 'View'. Mutually exclusive with 'paths'. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"gameObjectRef": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef"
|
||||||
|
},
|
||||||
|
"componentRef": {
|
||||||
|
"$ref": "#/$defs/AIGD.ComponentRef"
|
||||||
|
},
|
||||||
|
"includeFields": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"includeProperties": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"deepSerialization": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"paths": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(System.String)"
|
||||||
|
},
|
||||||
|
"viewQuery": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.ViewQuery"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.GameObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of a GameObject in hierarchy. Priority: 3."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
},
|
||||||
|
"AIGD.ComponentRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"index": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1."
|
||||||
|
},
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null."
|
||||||
|
},
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"index",
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Component reference. Used to find a Component at GameObject."
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(System.String)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.ViewQuery": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Navigate to this path first, then serialize only that subtree. Path segments are separated by '/'. Use '[i]' for array/list index (e.g. 'users/[2]/name') and '[key]' for dictionary entry (e.g. 'config/[timeout]'). A leading '#/' is stripped automatically. Examples: 'admin/name', 'users/[0]/email', 'config/[timeout]'. Leave null to start from the root object."
|
||||||
|
},
|
||||||
|
"NamePattern": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Case-insensitive .NET regex pattern matched against field and property names. Only branches containing at least one match are kept in the result tree. Examples: 'orbitRadius' (exact name), 'orbit.*' (prefix match), 'radius|speed' (either name). When nothing matches, the root envelope is returned with empty fields/props. Leave null to return all fields and properties without filtering."
|
||||||
|
},
|
||||||
|
"MaxDepth": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Maximum nesting depth of the returned serialized tree. 0 = root type name and value only — no nested fields or properties. 1 = one level of fields/props visible, their children stripped. 2 = two levels visible, and so on. Leave null (default) for unlimited depth."
|
||||||
|
},
|
||||||
|
"TypeFilter": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "When set, prunes the result tree to members whose runtime type is assignable to this type. Non-matching branches are removed; the root envelope is always preserved. Examples: typeof(float) keeps only float fields, typeof(IEnumerable) keeps only collections. Leave null to include members of any type."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"gameObjectRef",
|
||||||
|
"componentRef"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.GetComponentResponse"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.ComponentRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"index": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1."
|
||||||
|
},
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null."
|
||||||
|
},
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"index",
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Component reference. Used to find a Component at GameObject."
|
||||||
|
},
|
||||||
|
"AIGD.ComponentDataShallow": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"typeName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"isEnabled": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"False",
|
||||||
|
"True",
|
||||||
|
"NA"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID",
|
||||||
|
"isEnabled"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(com.IvanMurzak.ReflectorNet.Model.SerializedMember)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMember": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Object name."
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json."
|
||||||
|
},
|
||||||
|
"fields": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested field value."
|
||||||
|
},
|
||||||
|
"description": "Fields of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
},
|
||||||
|
"props": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested property value."
|
||||||
|
},
|
||||||
|
"description": "Properties of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"typeName"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.GetComponentResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Reference": {
|
||||||
|
"$ref": "#/$defs/AIGD.ComponentRef",
|
||||||
|
"description": "Reference to the component for future operations."
|
||||||
|
},
|
||||||
|
"Index": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Index of the component in the GameObject's component list."
|
||||||
|
},
|
||||||
|
"Component": {
|
||||||
|
"$ref": "#/$defs/AIGD.ComponentDataShallow",
|
||||||
|
"description": "Basic component information (type, enabled state)."
|
||||||
|
},
|
||||||
|
"Fields": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.ReflectorNet.Model.SerializedMember)",
|
||||||
|
"description": "Serialized fields of the component. Populated only on the legacy code path (no 'paths' / no 'viewQuery')."
|
||||||
|
},
|
||||||
|
"Properties": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.ReflectorNet.Model.SerializedMember)",
|
||||||
|
"description": "Serialized properties of the component. Populated only on the legacy code path (no 'paths' / no 'viewQuery')."
|
||||||
|
},
|
||||||
|
"View": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Path-scoped read or view-query result, populated when 'paths' or 'viewQuery' was supplied. Null otherwise."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"Index"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,131 @@
|
|||||||
|
---
|
||||||
|
name: gameobject-component-list-all
|
||||||
|
description: List the fully-qualified C# type names of every concrete `UnityEngine.Component` subclass available in the project. Paginated (default 5/page, max 500). Use this to find a valid `componentName` for 'gameobject-component-add'.
|
||||||
|
---
|
||||||
|
|
||||||
|
# GameObject / Component / List All
|
||||||
|
|
||||||
|
List C# class names extended from UnityEngine.Component. Use this to find component type names for 'gameobject-component-add' tool. Results are paginated to avoid overwhelming responses.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `search` (optional) — case-insensitive substring filter on type names.
|
||||||
|
- `page` (default 0, 0-based) — page index.
|
||||||
|
- `pageSize` (default 5, range 1..500) — items per page.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Enumerates `AllComponentTypes` (every non-abstract subclass of `UnityEngine.Component`), filters by `search` if supplied, then returns a `ComponentListResult` containing the requested page plus `TotalCount` / `TotalPages` so the caller can iterate.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool gameobject-component-list-all --input '{
|
||||||
|
"search": "string_value",
|
||||||
|
"page": 0,
|
||||||
|
"pageSize": 0
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool gameobject-component-list-all --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool gameobject-component-list-all --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `search` | `string` | No | Substring for searching components. Could be empty. |
|
||||||
|
| `page` | `integer` | No | Page number (0-based). Default is 0. |
|
||||||
|
| `pageSize` | `integer` | No | Number of items per page. Default is 5. Max is 500. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"search": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"page": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"pageSize": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.ComponentListResult"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.String-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.ComponentListResult": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Items": {
|
||||||
|
"$ref": "#/$defs/System.String-1",
|
||||||
|
"description": "Array of component type names for the current page."
|
||||||
|
},
|
||||||
|
"Page": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Current page number (0-based)."
|
||||||
|
},
|
||||||
|
"PageSize": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Number of items per page."
|
||||||
|
},
|
||||||
|
"TotalCount": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Total number of matching components."
|
||||||
|
},
|
||||||
|
"TotalPages": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Total number of pages available."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"Page",
|
||||||
|
"PageSize",
|
||||||
|
"TotalCount",
|
||||||
|
"TotalPages"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,321 @@
|
|||||||
|
---
|
||||||
|
name: gameobject-component-modify
|
||||||
|
description: Modify a specific Component on a GameObject in opened Prefab or in a Scene. Allows direct modification of component fields and properties without wrapping in GameObject structure. Use 'gameobject-component-get' first to inspect the component structure before modifying. Three modification surfaces are available (componentDiff, pathPatches, jsonPatch) — see the skill body for details.
|
||||||
|
---
|
||||||
|
|
||||||
|
# GameObject / Component / Modify
|
||||||
|
|
||||||
|
## Three modification surfaces
|
||||||
|
|
||||||
|
Use whichever fits the task:
|
||||||
|
|
||||||
|
1. `componentDiff` — full `SerializedMember` diff (legacy, backwards compatible).
|
||||||
|
2. `pathPatches` — list of `{path, value}` pairs routed through `Reflector.TryModifyAt`; atomic per-path modification, multiple entries can target different depths.
|
||||||
|
3. `jsonPatch` — a JSON Merge Patch (RFC 7396, extended with `[i]`/`[key]` notation) routed through `Reflector.TryPatch`; multiple fields at any depth in a single call.
|
||||||
|
|
||||||
|
When more than one is supplied they run in this order: `jsonPatch` → `pathPatches` → `componentDiff`. At least one is required.
|
||||||
|
|
||||||
|
## Path syntax
|
||||||
|
|
||||||
|
`fieldName`, `nested/field`, `arrayField/[i]`, `dictField/[key]`. Leading `#/` is stripped.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool gameobject-component-modify --input '{
|
||||||
|
"gameObjectRef": "string_value",
|
||||||
|
"componentRef": "string_value",
|
||||||
|
"componentDiff": "string_value",
|
||||||
|
"pathPatches": "string_value",
|
||||||
|
"jsonPatch": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool gameobject-component-modify --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool gameobject-component-modify --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `gameObjectRef` | `any` | Yes | Find GameObject in opened Prefab or in the active Scene. |
|
||||||
|
| `componentRef` | `any` | Yes | Component reference. Used to find a Component at GameObject. |
|
||||||
|
| `componentDiff` | `any` | No | Optional. The full component data to apply (legacy path). Should contain 'fields' and/or 'props' with the values to modify.
|
||||||
|
Only include the fields/properties you want to change.
|
||||||
|
Any unknown or invalid fields and properties will be reported in the response. |
|
||||||
|
| `pathPatches` | `any` | No | Optional. List of path-scoped patches routed through Reflector.TryModifyAt. Each entry targets one field/element/entry by path. Path syntax: 'fieldName', 'nested/field', 'arrayField/[i]', 'dictField/[key]'. |
|
||||||
|
| `jsonPatch` | `any` | No | Optional. JSON Merge Patch (RFC 7396, extended with [i]/[key] keys) routed through Reflector.TryPatch. Allows multiple fields at any depth to be updated in a single call. Use '$type' for compatible-subtype replacement. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"gameObjectRef": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef"
|
||||||
|
},
|
||||||
|
"componentRef": {
|
||||||
|
"$ref": "#/$defs/AIGD.ComponentRef"
|
||||||
|
},
|
||||||
|
"componentDiff": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember"
|
||||||
|
},
|
||||||
|
"pathPatches": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(AIGD.PathPatch)"
|
||||||
|
},
|
||||||
|
"jsonPatch": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.GameObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of a GameObject in hierarchy. Priority: 3."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
},
|
||||||
|
"AIGD.ComponentRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"index": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1."
|
||||||
|
},
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null."
|
||||||
|
},
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"index",
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Component reference. Used to find a Component at GameObject."
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMember": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Object name."
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json."
|
||||||
|
},
|
||||||
|
"fields": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested field value."
|
||||||
|
},
|
||||||
|
"description": "Fields of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
},
|
||||||
|
"props": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested property value."
|
||||||
|
},
|
||||||
|
"description": "Properties of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"typeName"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"AIGD.PathPatch": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Slash-delimited path to the target field/element/entry. Plain segment navigates a field or property (e.g. 'admin' or 'admin/name'). Use '[i]' for array/list index (e.g. 'planets/[0]/orbitRadius'). Use '[key]' for dictionary entry (e.g. 'config/[timeout]'). A leading '#/' is stripped automatically. Required."
|
||||||
|
},
|
||||||
|
"Value": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "The new value to write at the path. Use the standard SerializedMember envelope: 'typeName' + 'value' for primitives, or nested 'fields'/'props' for complex types. Required — omitting it overwrites the target with a default empty SerializedMember."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(AIGD.PathPatch)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.PathPatch"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"gameObjectRef",
|
||||||
|
"componentRef"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.ModifyComponentResponse"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.ComponentRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"index": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Component 'index' attached to a gameObject. The first index is '0' and that is usually Transform or RectTransform. Priority: 2. Default value is -1."
|
||||||
|
},
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Component type full name. Sample 'UnityEngine.Transform'. If the gameObject has two components of the same type, the output component is unpredictable. Priority: 3. Default value is null."
|
||||||
|
},
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"index",
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Component reference. Used to find a Component at GameObject."
|
||||||
|
},
|
||||||
|
"AIGD.ComponentDataShallow": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"typeName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"isEnabled": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"False",
|
||||||
|
"True",
|
||||||
|
"NA"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID",
|
||||||
|
"isEnabled"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"System.String-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.ModifyComponentResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Success": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether the modification was successful."
|
||||||
|
},
|
||||||
|
"Reference": {
|
||||||
|
"$ref": "#/$defs/AIGD.ComponentRef",
|
||||||
|
"description": "Reference to the modified component."
|
||||||
|
},
|
||||||
|
"Index": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Index of the component in the GameObject's component list."
|
||||||
|
},
|
||||||
|
"Component": {
|
||||||
|
"$ref": "#/$defs/AIGD.ComponentDataShallow",
|
||||||
|
"description": "Updated component information after modification."
|
||||||
|
},
|
||||||
|
"Logs": {
|
||||||
|
"$ref": "#/$defs/System.String-1",
|
||||||
|
"description": "Log of modifications made and any warnings/errors encountered."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"Success",
|
||||||
|
"Index"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,221 @@
|
|||||||
|
---
|
||||||
|
name: gameobject-create
|
||||||
|
description: Create a new GameObject in the currently opened Prefab or active Scene, optionally parented under another GameObject and pre-positioned. Pass `primitiveType` to spawn a Unity primitive (Cube, Sphere, etc.) instead of an empty GameObject.
|
||||||
|
---
|
||||||
|
|
||||||
|
# GameObject / Create
|
||||||
|
|
||||||
|
Create a new GameObject in opened Prefab or in a Scene. If needed - provide proper 'position', 'rotation' and 'scale' to reduce amount of operations.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `name` — required non-empty name.
|
||||||
|
- `parentGameObjectRef` (optional) — when provided, the new GameObject is parented under this one (`SetParent(parent, worldPositionStays: false)`); otherwise it's created at scene/prefab root.
|
||||||
|
- `position` / `rotation` / `scale` — optional transform; default to zero / zero / one.
|
||||||
|
- `isLocalSpace` — when `true`, applies the transform in local space relative to the parent.
|
||||||
|
- `primitiveType` (optional) — when set, the GameObject is created via `GameObject.CreatePrimitive` (adds the appropriate renderer/collider for the primitive shape).
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool gameobject-create --input '{
|
||||||
|
"name": "string_value",
|
||||||
|
"parentGameObjectRef": "string_value",
|
||||||
|
"position": "string_value",
|
||||||
|
"rotation": "string_value",
|
||||||
|
"scale": "string_value",
|
||||||
|
"isLocalSpace": false,
|
||||||
|
"primitiveType": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool gameobject-create --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool gameobject-create --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `name` | `string` | Yes | Name of the new GameObject. |
|
||||||
|
| `parentGameObjectRef` | `any` | No | Parent GameObject reference. If not provided, the GameObject will be created at the root of the scene or prefab. |
|
||||||
|
| `position` | `any` | No | Transform position of the GameObject. |
|
||||||
|
| `rotation` | `any` | No | Transform rotation of the GameObject. Euler angles in degrees. |
|
||||||
|
| `scale` | `any` | No | Transform scale of the GameObject. |
|
||||||
|
| `isLocalSpace` | `boolean` | No | World or Local space of transform. |
|
||||||
|
| `primitiveType` | `any` | No | |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"parentGameObjectRef": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef"
|
||||||
|
},
|
||||||
|
"position": {
|
||||||
|
"$ref": "#/$defs/UnityEngine.Vector3"
|
||||||
|
},
|
||||||
|
"rotation": {
|
||||||
|
"$ref": "#/$defs/UnityEngine.Vector3"
|
||||||
|
},
|
||||||
|
"scale": {
|
||||||
|
"$ref": "#/$defs/UnityEngine.Vector3"
|
||||||
|
},
|
||||||
|
"isLocalSpace": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"primitiveType": {
|
||||||
|
"$ref": "#/$defs/UnityEngine.PrimitiveType"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.GameObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of a GameObject in hierarchy. Priority: 3."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
},
|
||||||
|
"UnityEngine.Vector3": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"x": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"y": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"z": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"x",
|
||||||
|
"y",
|
||||||
|
"z"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"UnityEngine.PrimitiveType": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"Sphere",
|
||||||
|
"Capsule",
|
||||||
|
"Cylinder",
|
||||||
|
"Cube",
|
||||||
|
"Plane",
|
||||||
|
"Quad"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"name"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef",
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.GameObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of a GameObject in hierarchy. Priority: 3."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,139 @@
|
|||||||
|
---
|
||||||
|
name: gameobject-destroy
|
||||||
|
description: Destroy a GameObject (and all nested children) in the currently opened Prefab or active Scene. Returns the destroyed GameObject's name, path, and instance ID for confirmation. Use 'gameobject-find' to locate the target first.
|
||||||
|
---
|
||||||
|
|
||||||
|
# GameObject / Destroy
|
||||||
|
|
||||||
|
Destroy GameObject and all nested GameObjects recursively in opened Prefab or in a Scene. Use 'gameobject-find' tool to find the target GameObject first.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Validates the `gameObjectRef`, resolves it on the main thread, then calls `Object.DestroyImmediate` (the immediate variant is required for Editor-mode operations). Returns a `DestroyGameObjectResult` containing `DestroyedName`, `DestroyedPath`, and `DestroyedInstanceId` so the caller has a record of what was removed.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool gameobject-destroy --input '{
|
||||||
|
"gameObjectRef": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool gameobject-destroy --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool gameobject-destroy --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `gameObjectRef` | `any` | Yes | Find GameObject in opened Prefab or in the active Scene. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"gameObjectRef": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.GameObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of a GameObject in hierarchy. Priority: 3."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"gameObjectRef"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.DestroyGameObjectResult"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.DestroyGameObjectResult": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"DestroyedName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of the destroyed GameObject."
|
||||||
|
},
|
||||||
|
"DestroyedPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Hierarchy path of the destroyed GameObject."
|
||||||
|
},
|
||||||
|
"DestroyedInstanceId": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Instance ID of the destroyed GameObject."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"DestroyedInstanceId"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,174 @@
|
|||||||
|
---
|
||||||
|
name: gameobject-duplicate
|
||||||
|
description: Duplicate a batch of GameObjects in the currently opened Prefab or active Scene. Marks each affected scene as dirty after duplication. Use 'gameobject-find' to locate the source GameObjects first.
|
||||||
|
---
|
||||||
|
|
||||||
|
# GameObject / Duplicate
|
||||||
|
|
||||||
|
Duplicate GameObjects in opened Prefab or in a Scene. Use 'gameobject-find' tool to find the target GameObjects first.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `gameObjectRefs` — `GameObjectRefList` of source GameObjects.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Resolves every input ref on the main thread (throwing on any unresolved entry to keep the batch atomic). Sets `Selection.entityIds`/`instanceIDs` to the sources and invokes `Unsupported.DuplicateGameObjectsUsingPasteboard()` (Unity's canonical duplicate routine). Marks every distinct affected scene dirty so the duplicated objects are saved with the scene. Returns refs to the sources (the duplicates are reachable via the post-call `Selection`).
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool gameobject-duplicate --input '{
|
||||||
|
"gameObjectRefs": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool gameobject-duplicate --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool gameobject-duplicate --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `gameObjectRefs` | `any` | Yes | Array of GameObjects in opened Prefab or in the active Scene. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"gameObjectRefs": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRefList"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.GameObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of a GameObject in hierarchy. Priority: 3."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
},
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.GameObjectRefList": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef",
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
},
|
||||||
|
"description": "Array of GameObjects in opened Prefab or in the active Scene."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"gameObjectRefs"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(AIGD.GameObjectRef)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.GameObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of a GameObject in hierarchy. Priority: 3."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
},
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(AIGD.GameObjectRef)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef",
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,413 @@
|
|||||||
|
---
|
||||||
|
name: gameobject-find
|
||||||
|
description: Find a specific GameObject in the opened Prefab (preferred when present) or the active Scene. Optionally include editable data, components preview, bounds, and limited hierarchy. Supports token-saving path-scoped reads via `paths` or `viewQuery`.
|
||||||
|
---
|
||||||
|
|
||||||
|
# GameObject / Find
|
||||||
|
|
||||||
|
Finds specific GameObject by provided information in opened Prefab or in a Scene. First it looks for the opened Prefab, if any Prefab is opened it looks only there ignoring a scene. If no opened Prefab it looks into current active scene. Returns GameObject information and its children. Also, it returns Components preview just for the target GameObject.
|
||||||
|
|
||||||
|
## Toggles (all default `false` to keep responses small)
|
||||||
|
|
||||||
|
- `includeData` — full editable GameObject data (tag, layer, etc.).
|
||||||
|
- `includeComponents` — attached components references.
|
||||||
|
- `includeBounds` — 3D bounds.
|
||||||
|
- `includeHierarchy` — hierarchy metadata.
|
||||||
|
- `hierarchyDepth` (default 0) — depth of the hierarchy to include. `0` = target only, `1` = one layer below, etc.
|
||||||
|
|
||||||
|
## Path-scoped reads (token-saving)
|
||||||
|
|
||||||
|
Supply `paths` (a list of paths) to read only the listed fields/elements via `Reflector.TryReadAt`, or `viewQuery` (a `ViewQuery`) to navigate to a subtree and/or filter by name regex / max depth / type via `Reflector.View`. When either is supplied, the result populates `Data` on the returned `GameObjectData` and overrides `includeData` (which would otherwise produce a full recursive serialization). These two parameters are mutually exclusive — supply at most one.
|
||||||
|
|
||||||
|
## Path syntax
|
||||||
|
|
||||||
|
`fieldName`, `nested/field`, `arrayField/[i]`, `dictField/[key]`. Leading `#/` is stripped.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool gameobject-find --input '{
|
||||||
|
"gameObjectRef": "string_value",
|
||||||
|
"includeData": false,
|
||||||
|
"includeComponents": false,
|
||||||
|
"includeBounds": false,
|
||||||
|
"includeHierarchy": false,
|
||||||
|
"hierarchyDepth": 0,
|
||||||
|
"paths": "string_value",
|
||||||
|
"viewQuery": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool gameobject-find --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool gameobject-find --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `gameObjectRef` | `any` | Yes | Find GameObject in opened Prefab or in the active Scene. |
|
||||||
|
| `includeData` | `boolean` | No | Include editable GameObject data (tag, layer, etc). |
|
||||||
|
| `includeComponents` | `boolean` | No | Include attached components references. |
|
||||||
|
| `includeBounds` | `boolean` | No | Include 3D bounds of the GameObject. |
|
||||||
|
| `includeHierarchy` | `boolean` | No | Include hierarchy metadata. |
|
||||||
|
| `hierarchyDepth` | `integer` | No | Determines the depth of the hierarchy to include. 0 - means only the target GameObject. 1 - means to include one layer below. |
|
||||||
|
| `paths` | `any` | No | Optional. List of paths to read individually via Reflector.TryReadAt. When supplied, replaces 'includeData'-style full serialization with a path-scoped aggregate. Path syntax: 'fieldName', 'nested/field', 'arrayField/[i]', 'dictField/[key]'. Mutually exclusive with 'viewQuery'. |
|
||||||
|
| `viewQuery` | `any` | No | Optional. View-query filter routed through Reflector.View. When supplied, replaces 'includeData'-style full serialization with the filtered subtree. Mutually exclusive with 'paths'. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"gameObjectRef": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef"
|
||||||
|
},
|
||||||
|
"includeData": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"includeComponents": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"includeBounds": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"includeHierarchy": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"hierarchyDepth": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"paths": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(System.String)"
|
||||||
|
},
|
||||||
|
"viewQuery": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.ViewQuery"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.GameObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of a GameObject in hierarchy. Priority: 3."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(System.String)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.ViewQuery": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Navigate to this path first, then serialize only that subtree. Path segments are separated by '/'. Use '[i]' for array/list index (e.g. 'users/[2]/name') and '[key]' for dictionary entry (e.g. 'config/[timeout]'). A leading '#/' is stripped automatically. Examples: 'admin/name', 'users/[0]/email', 'config/[timeout]'. Leave null to start from the root object."
|
||||||
|
},
|
||||||
|
"NamePattern": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Case-insensitive .NET regex pattern matched against field and property names. Only branches containing at least one match are kept in the result tree. Examples: 'orbitRadius' (exact name), 'orbit.*' (prefix match), 'radius|speed' (either name). When nothing matches, the root envelope is returned with empty fields/props. Leave null to return all fields and properties without filtering."
|
||||||
|
},
|
||||||
|
"MaxDepth": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Maximum nesting depth of the returned serialized tree. 0 = root type name and value only — no nested fields or properties. 1 = one level of fields/props visible, their children stripped. 2 = two levels visible, and so on. Leave null (default) for unlimited depth."
|
||||||
|
},
|
||||||
|
"TypeFilter": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "When set, prunes the result tree to members whose runtime type is assignable to this type. Non-matching branches are removed; the root envelope is always preserved. Examples: typeof(float) keeps only float fields, typeof(IEnumerable) keeps only collections. Leave null to include members of any type."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"gameObjectRef"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectData"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.GameObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of a GameObject in hierarchy. Priority: 3."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
},
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMember": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Object name."
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json."
|
||||||
|
},
|
||||||
|
"fields": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested field value."
|
||||||
|
},
|
||||||
|
"description": "Fields of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
},
|
||||||
|
"props": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested property value."
|
||||||
|
},
|
||||||
|
"description": "Properties of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"typeName"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"UnityEngine.Bounds": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"center": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"x": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"y": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"z": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"x",
|
||||||
|
"y",
|
||||||
|
"z"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"size": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"x": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"y": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"z": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"x",
|
||||||
|
"y",
|
||||||
|
"z"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"center",
|
||||||
|
"size"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"AIGD.GameObjectMetadata": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"sceneName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"tag": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"activeSelf": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"activeInHierarchy": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"children": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(AIGD.GameObjectMetadata)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID",
|
||||||
|
"activeSelf",
|
||||||
|
"activeInHierarchy"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(AIGD.GameObjectMetadata)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectMetadata"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.ComponentDataShallow-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.ComponentDataShallow"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.ComponentDataShallow": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"typeName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"isEnabled": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"False",
|
||||||
|
"True",
|
||||||
|
"NA"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID",
|
||||||
|
"isEnabled"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"AIGD.GameObjectData": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Reference": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef",
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
},
|
||||||
|
"Data": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "GameObject editable data (tag, layer, etc)."
|
||||||
|
},
|
||||||
|
"Bounds": {
|
||||||
|
"$ref": "#/$defs/UnityEngine.Bounds",
|
||||||
|
"description": "Bounds of the GameObject."
|
||||||
|
},
|
||||||
|
"Hierarchy": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectMetadata",
|
||||||
|
"description": "Hierarchy metadata of the GameObject."
|
||||||
|
},
|
||||||
|
"Components": {
|
||||||
|
"$ref": "#/$defs/AIGD.ComponentDataShallow-1",
|
||||||
|
"description": "Attached components shallow data of the GameObject (Read-only, use Component modification tool for modification)."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,256 @@
|
|||||||
|
---
|
||||||
|
name: gameobject-modify
|
||||||
|
description: Modify GameObject fields and properties in opened Prefab or in a Scene. You can modify multiple GameObjects at once. Just provide the same number of GameObject references and SerializedMember objects. Three modification surfaces are available per GameObject (gameObjectDiffs, pathPatchesPerGameObject, jsonPatchesPerGameObject) — see the skill body for details.
|
||||||
|
---
|
||||||
|
|
||||||
|
# GameObject / Modify
|
||||||
|
|
||||||
|
## Three modification surfaces
|
||||||
|
|
||||||
|
Per GameObject — parallel arrays must have the same length as `gameObjectRefs`:
|
||||||
|
|
||||||
|
1. `gameObjectDiffs` — full `SerializedMember` diff per GameObject (legacy, backwards compatible).
|
||||||
|
2. `pathPatchesPerGameObject` — list of `{path, value}` patches per GameObject routed through `Reflector.TryModifyAt`; atomic per-path modification.
|
||||||
|
3. `jsonPatchesPerGameObject` — JSON Merge Patch per GameObject routed through `Reflector.TryPatch`.
|
||||||
|
|
||||||
|
When more than one is supplied for the same GameObject they run in this order: `jsonPatch` → `pathPatches` → `diff`. At least one of the three is required.
|
||||||
|
|
||||||
|
## Path syntax
|
||||||
|
|
||||||
|
`fieldName`, `nested/field`, `arrayField/[i]`, `dictField/[key]`.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool gameobject-modify --input '{
|
||||||
|
"gameObjectRefs": "string_value",
|
||||||
|
"gameObjectDiffs": "string_value",
|
||||||
|
"pathPatchesPerGameObject": "string_value",
|
||||||
|
"jsonPatchesPerGameObject": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool gameobject-modify --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool gameobject-modify --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `gameObjectRefs` | `any` | Yes | Array of GameObjects in opened Prefab or in the active Scene. |
|
||||||
|
| `gameObjectDiffs` | `any` | No | Optional. Each item in the array represents a GameObject modification of the 'gameObjectRefs' at the same index. Usually a GameObject is a container for components. Each component may have fields and properties for modification. If you need to modify components of a GameObject, please use 'gameobject-component-modify' tool. Ignore values that should not be modified. Any unknown or wrong located fields and properties will be ignored. Check the result of this command to see what was changed. The ignored fields and properties will be listed. |
|
||||||
|
| `pathPatchesPerGameObject` | `any` | No | Optional. Per-GameObject list of path-scoped patches routed through Reflector.TryModifyAt. Outer index aligns with 'gameObjectRefs'; inner list contains {path, value} entries. Pass null or omit for GameObjects that should not receive path patches. |
|
||||||
|
| `jsonPatchesPerGameObject` | `any` | No | Optional. Per-GameObject JSON Merge Patch (RFC 7396, extended with [i]/[key] keys) routed through Reflector.TryPatch. Outer index aligns with 'gameObjectRefs'. Pass null or omit for GameObjects that should not receive a JSON patch. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"gameObjectRefs": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRefList"
|
||||||
|
},
|
||||||
|
"gameObjectDiffs": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMemberList"
|
||||||
|
},
|
||||||
|
"pathPatchesPerGameObject": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(System.Collections.Generic.List(AIGD.PathPatch))"
|
||||||
|
},
|
||||||
|
"jsonPatchesPerGameObject": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(System.String)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.GameObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of a GameObject in hierarchy. Priority: 3."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
},
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.GameObjectRefList": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef",
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
},
|
||||||
|
"description": "Array of GameObjects in opened Prefab or in the active Scene."
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMember": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Object name."
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json."
|
||||||
|
},
|
||||||
|
"fields": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested field value."
|
||||||
|
},
|
||||||
|
"description": "Fields of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
},
|
||||||
|
"props": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested property value."
|
||||||
|
},
|
||||||
|
"description": "Properties of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"typeName"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(AIGD.PathPatch)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.PathPatch"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.PathPatch": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Slash-delimited path to the target field/element/entry. Plain segment navigates a field or property (e.g. 'admin' or 'admin/name'). Use '[i]' for array/list index (e.g. 'planets/[0]/orbitRadius'). Use '[key]' for dictionary entry (e.g. 'config/[timeout]'). A leading '#/' is stripped automatically. Required."
|
||||||
|
},
|
||||||
|
"Value": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "The new value to write at the path. Use the standard SerializedMember envelope: 'typeName' + 'value' for primitives, or nested 'fields'/'props' for complex types. Required — omitting it overwrites the target with a default empty SerializedMember."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(System.Collections.Generic.List(AIGD.PathPatch))": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(AIGD.PathPatch)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(System.String)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"gameObjectRefs"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.Logs"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.LogEntry": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Depth": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"Message": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"Type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"Trace",
|
||||||
|
"Debug",
|
||||||
|
"Info",
|
||||||
|
"Success",
|
||||||
|
"Warning",
|
||||||
|
"Error",
|
||||||
|
"Critical"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"Depth",
|
||||||
|
"Type"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.Logs": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.LogEntry"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,142 @@
|
|||||||
|
---
|
||||||
|
name: gameobject-set-parent
|
||||||
|
description: Reparent a batch of GameObjects under a new parent in the currently opened Prefab or active Scene. Per-item failures are reported in the returned status string instead of aborting the batch. Use 'gameobject-find' to locate the GameObjects first.
|
||||||
|
---
|
||||||
|
|
||||||
|
# GameObject / Set Parent
|
||||||
|
|
||||||
|
Set parent GameObject to list of GameObjects in opened Prefab or in a Scene. Use 'gameobject-find' tool to find the target GameObjects first.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `gameObjectRefs` — list of children to reparent.
|
||||||
|
- `parentGameObjectRef` — new parent. Must resolve, otherwise the call returns early with an error string.
|
||||||
|
- `worldPositionStays` (default `true`) — preserve world-space transform when reparenting (passed to `Transform.SetParent`).
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Iterates `gameObjectRefs` and reparents each one independently; per-item resolve errors are appended to the returned status string instead of throwing. After the loop, if at least one reparent succeeded, marks the active scene dirty and repaints editor windows.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool gameobject-set-parent --input '{
|
||||||
|
"gameObjectRefs": "string_value",
|
||||||
|
"parentGameObjectRef": "string_value",
|
||||||
|
"worldPositionStays": false
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool gameobject-set-parent --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool gameobject-set-parent --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `gameObjectRefs` | `any` | Yes | List of references to the GameObjects to set new parent. |
|
||||||
|
| `parentGameObjectRef` | `any` | Yes | Reference to the parent GameObject. |
|
||||||
|
| `worldPositionStays` | `boolean` | No | A boolean flag indicating whether the GameObject's world position should remain unchanged when setting its parent. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"gameObjectRefs": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRefList"
|
||||||
|
},
|
||||||
|
"parentGameObjectRef": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef"
|
||||||
|
},
|
||||||
|
"worldPositionStays": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.GameObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of a GameObject in hierarchy. Priority: 3."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
},
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.GameObjectRefList": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef",
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
},
|
||||||
|
"description": "Array of GameObjects in opened Prefab or in the active Scene."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"gameObjectRefs",
|
||||||
|
"parentGameObjectRef"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,182 @@
|
|||||||
|
---
|
||||||
|
name: object-get-data
|
||||||
|
description: Get serialized data for a Unity `UnityEngine.Object` — all serializable fields and properties. Supports token-saving path-scoped reads via `paths` or `viewQuery`. Pair with 'object-modify' when you need to write back.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Object / Get Data
|
||||||
|
|
||||||
|
Get data of the specified Unity Object. Returns serialized data of the object including its properties and fields. If need to modify the data use 'object-modify' tool.
|
||||||
|
|
||||||
|
## Path-scoped reads (token-saving)
|
||||||
|
|
||||||
|
Supply `paths` (a list of paths) to read only the listed fields/elements via `Reflector.TryReadAt`, or `viewQuery` (a `ViewQuery`) to navigate to a subtree and/or filter by name regex / max depth / type via `Reflector.View`. These two parameters are mutually exclusive — supply at most one. When neither is supplied the full object is serialized (backwards compatible).
|
||||||
|
|
||||||
|
## Path syntax
|
||||||
|
|
||||||
|
`fieldName`, `nested/field`, `arrayField/[i]`, `dictField/[key]`. Leading `#/` is stripped.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool object-get-data --input '{
|
||||||
|
"objectRef": "string_value",
|
||||||
|
"paths": "string_value",
|
||||||
|
"viewQuery": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool object-get-data --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool object-get-data --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `objectRef` | `any` | Yes | Reference to UnityEngine.Object instance. It could be GameObject, Component, Asset, etc. Anything extended from UnityEngine.Object. |
|
||||||
|
| `paths` | `any` | No | Optional. List of paths to read individually via Reflector.TryReadAt. Each path may target a different depth. Path syntax: 'fieldName', 'nested/field', 'arrayField/[i]', 'dictField/[key]'. Mutually exclusive with 'viewQuery'. |
|
||||||
|
| `viewQuery` | `any` | No | Optional. View-query filter routed through Reflector.View — combines a starting Path, a case-insensitive NamePattern regex, MaxDepth, and an optional TypeFilter. Mutually exclusive with 'paths'. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"objectRef": {
|
||||||
|
"$ref": "#/$defs/AIGD.ObjectRef"
|
||||||
|
},
|
||||||
|
"paths": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(System.String)"
|
||||||
|
},
|
||||||
|
"viewQuery": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.ViewQuery"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.ObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Reference to UnityEngine.Object instance. It could be GameObject, Component, Asset, etc. Anything extended from UnityEngine.Object."
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(System.String)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.ViewQuery": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Navigate to this path first, then serialize only that subtree. Path segments are separated by '/'. Use '[i]' for array/list index (e.g. 'users/[2]/name') and '[key]' for dictionary entry (e.g. 'config/[timeout]'). A leading '#/' is stripped automatically. Examples: 'admin/name', 'users/[0]/email', 'config/[timeout]'. Leave null to start from the root object."
|
||||||
|
},
|
||||||
|
"NamePattern": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Case-insensitive .NET regex pattern matched against field and property names. Only branches containing at least one match are kept in the result tree. Examples: 'orbitRadius' (exact name), 'orbit.*' (prefix match), 'radius|speed' (either name). When nothing matches, the root envelope is returned with empty fields/props. Leave null to return all fields and properties without filtering."
|
||||||
|
},
|
||||||
|
"MaxDepth": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Maximum nesting depth of the returned serialized tree. 0 = root type name and value only — no nested fields or properties. 1 = one level of fields/props visible, their children stripped. 2 = two levels visible, and so on. Leave null (default) for unlimited depth."
|
||||||
|
},
|
||||||
|
"TypeFilter": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "When set, prunes the result tree to members whose runtime type is assignable to this type. Non-matching branches are removed; the root envelope is always preserved. Examples: typeof(float) keeps only float fields, typeof(IEnumerable) keeps only collections. Leave null to include members of any type."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"objectRef"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMember": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Object name."
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json."
|
||||||
|
},
|
||||||
|
"fields": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested field value."
|
||||||
|
},
|
||||||
|
"description": "Fields of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
},
|
||||||
|
"props": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested property value."
|
||||||
|
},
|
||||||
|
"description": "Properties of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"typeName"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,277 @@
|
|||||||
|
---
|
||||||
|
name: object-modify
|
||||||
|
description: Modify a Unity `UnityEngine.Object`'s serializable fields/properties. Three modification surfaces are available (`objectDiff`, `pathPatches`, `jsonPatch`) — see the skill body. Use 'object-get-data' first to inspect the object structure.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Object / Modify
|
||||||
|
|
||||||
|
Modify the specified Unity Object. Allows direct modification of object fields and properties. Use 'object-get-data' first to inspect the object structure before modifying.
|
||||||
|
|
||||||
|
## Three modification surfaces
|
||||||
|
|
||||||
|
Use whichever fits the task:
|
||||||
|
|
||||||
|
1. `objectDiff` — full `SerializedMember` diff (legacy, backwards compatible).
|
||||||
|
2. `pathPatches` — list of `{path, value}` pairs routed through `Reflector.TryModifyAt`; atomic per-path modification, multiple entries can target different depths.
|
||||||
|
3. `jsonPatch` — a JSON Merge Patch (RFC 7396, extended with `[i]`/`[key]` notation) routed through `Reflector.TryPatch`; multiple fields at any depth in a single call.
|
||||||
|
|
||||||
|
When more than one is supplied they run in this order: `jsonPatch` → `pathPatches` → `objectDiff`. At least one is required.
|
||||||
|
|
||||||
|
## Path syntax
|
||||||
|
|
||||||
|
`fieldName`, `nested/field`, `arrayField/[i]`, `dictField/[key]`. Leading `#/` is stripped.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool object-modify --input '{
|
||||||
|
"objectRef": "string_value",
|
||||||
|
"objectDiff": "string_value",
|
||||||
|
"pathPatches": "string_value",
|
||||||
|
"jsonPatch": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool object-modify --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool object-modify --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `objectRef` | `any` | Yes | Reference to UnityEngine.Object instance. It could be GameObject, Component, Asset, etc. Anything extended from UnityEngine.Object. |
|
||||||
|
| `objectDiff` | `any` | No | Optional. The full object data to apply (legacy path). Should contain 'fields' and/or 'props' with the values to modify.
|
||||||
|
Only include the fields/properties you want to change.
|
||||||
|
Any unknown or invalid fields and properties will be reported in the response. |
|
||||||
|
| `pathPatches` | `any` | No | Optional. List of path-scoped patches routed through Reflector.TryModifyAt. |
|
||||||
|
| `jsonPatch` | `any` | No | Optional. JSON Merge Patch (RFC 7396, extended with [i]/[key] keys) routed through Reflector.TryPatch. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"objectRef": {
|
||||||
|
"$ref": "#/$defs/AIGD.ObjectRef"
|
||||||
|
},
|
||||||
|
"objectDiff": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember"
|
||||||
|
},
|
||||||
|
"pathPatches": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(AIGD.PathPatch)"
|
||||||
|
},
|
||||||
|
"jsonPatch": {
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.ObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Reference to UnityEngine.Object instance. It could be GameObject, Component, Asset, etc. Anything extended from UnityEngine.Object."
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMember": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Object name."
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json."
|
||||||
|
},
|
||||||
|
"fields": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested field value."
|
||||||
|
},
|
||||||
|
"description": "Fields of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
},
|
||||||
|
"props": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested property value."
|
||||||
|
},
|
||||||
|
"description": "Properties of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"typeName"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"AIGD.PathPatch": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Slash-delimited path to the target field/element/entry. Plain segment navigates a field or property (e.g. 'admin' or 'admin/name'). Use '[i]' for array/list index (e.g. 'planets/[0]/orbitRadius'). Use '[key]' for dictionary entry (e.g. 'config/[timeout]'). A leading '#/' is stripped automatically. Required."
|
||||||
|
},
|
||||||
|
"Value": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "The new value to write at the path. Use the standard SerializedMember envelope: 'typeName' + 'value' for primitives, or nested 'fields'/'props' for complex types. Required — omitting it overwrites the target with a default empty SerializedMember."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(AIGD.PathPatch)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.PathPatch"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"objectRef"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.ModifyObjectResponse"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.ObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Reference to UnityEngine.Object instance. It could be GameObject, Component, Asset, etc. Anything extended from UnityEngine.Object."
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMember": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Object name."
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json."
|
||||||
|
},
|
||||||
|
"fields": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested field value."
|
||||||
|
},
|
||||||
|
"description": "Fields of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
},
|
||||||
|
"props": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested property value."
|
||||||
|
},
|
||||||
|
"description": "Properties of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"typeName"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.String-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.ModifyObjectResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Success": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether the modification was successful."
|
||||||
|
},
|
||||||
|
"Reference": {
|
||||||
|
"$ref": "#/$defs/AIGD.ObjectRef",
|
||||||
|
"description": "Reference to the modified object."
|
||||||
|
},
|
||||||
|
"Data": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Updated object data after modification."
|
||||||
|
},
|
||||||
|
"Logs": {
|
||||||
|
"$ref": "#/$defs/System.String-1",
|
||||||
|
"description": "Log of modifications made and any warnings/errors encountered."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"Success"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
---
|
||||||
|
name: package-add
|
||||||
|
description: Install a Unity package from the registry, a Git URL, or a local path. Modifies `manifest.json` and triggers package resolution; may also trigger a domain reload — the final result is delivered after the reload via the request's `requestId`. Use 'package-search' / 'package-list' for discovery first.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Package Manager / Add
|
||||||
|
|
||||||
|
Install a package from the Unity Package Manager registry, Git URL, or local path. This operation modifies the project's manifest.json and triggers package resolution. Note: Package installation may trigger a domain reload. The result will be sent after the reload completes. Use 'package-search' tool to search for packages and 'package-list' to list installed packages.
|
||||||
|
|
||||||
|
## `packageId` formats
|
||||||
|
|
||||||
|
- Plain package ID: `com.unity.textmeshpro` (installs latest compatible version).
|
||||||
|
- Pinned version: `com.unity.textmeshpro@3.0.6`.
|
||||||
|
- Git URL: `https://github.com/user/repo.git`.
|
||||||
|
- Git URL with branch/tag: `https://github.com/user/repo.git#v1.0.0`.
|
||||||
|
- Local path: `file:../MyPackage`.
|
||||||
|
|
||||||
|
## Processing model
|
||||||
|
|
||||||
|
Returns `Processing` immediately with the supplied `requestId`. Once `Client.Add` completes, a follow-up result is delivered: success → `SchedulePostDomainReloadNotification` (delivers after the reload finishes), failure → an immediate error notification with the underlying Unity error message.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool package-add --input '{
|
||||||
|
"packageId": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool package-add --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool package-add --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `packageId` | `string` | Yes | The package ID to install. Formats: Package ID 'com.unity.textmeshpro' (installs latest compatible version), Package ID with version 'com.unity.textmeshpro@3.0.6', Git URL 'https://github.com/user/repo.git', Git URL with branch/tag 'https://github.com/user/repo.git#v1.0.0', Local path 'file:../MyPackage'. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"packageId": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"packageId"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
This tool does not return structured output.
|
||||||
|
|
||||||
@@ -0,0 +1,136 @@
|
|||||||
|
---
|
||||||
|
name: package-list
|
||||||
|
description: List all UPM packages installed in the Unity project — name, version, source, description. Optionally filter by source (registry, embedded, local, git, built-in, local tarball), by name/display/description substring, and by direct-dependency-only.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Package Manager / List Installed
|
||||||
|
|
||||||
|
List all packages installed in the Unity project (UPM packages). Returns information about each installed package including name, version, source, and description. Use this to check which packages are currently installed before adding or removing packages.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `sourceFilter` (default `All`) — restrict by Unity `PackageSource`: `All`, `Registry`, `Embedded`, `Local`, `Git`, `BuiltIn`, `LocalTarball`.
|
||||||
|
- `nameFilter` (optional) — case-insensitive substring filter over name / displayName / description. Results are prioritized: exact name → exact displayName → name substring → displayName substring → description substring.
|
||||||
|
- `directDependenciesOnly` (default `false`) — when true, return only packages listed in `manifest.json` (no transitive dependencies).
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool package-list --input '{
|
||||||
|
"sourceFilter": "string_value",
|
||||||
|
"nameFilter": "string_value",
|
||||||
|
"directDependenciesOnly": false
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool package-list --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool package-list --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `sourceFilter` | `string` | No | Filter packages by source. |
|
||||||
|
| `nameFilter` | `string` | No | Filter packages by name, display name, or description (case-insensitive). Results are prioritized: exact name match, exact display name match, name substring, display name substring, description substring. |
|
||||||
|
| `directDependenciesOnly` | `boolean` | No | Include only direct dependencies (packages in manifest.json). If false, includes all resolved packages. Default: false |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"sourceFilter": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"All",
|
||||||
|
"Registry",
|
||||||
|
"Embedded",
|
||||||
|
"Local",
|
||||||
|
"Git",
|
||||||
|
"BuiltIn",
|
||||||
|
"LocalTarball"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"nameFilter": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"directDependenciesOnly": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(AIGD.PackageData)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.PackageData": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The official Unity name of the package used as the package ID."
|
||||||
|
},
|
||||||
|
"DisplayName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The display name of the package."
|
||||||
|
},
|
||||||
|
"Version": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The version of the package."
|
||||||
|
},
|
||||||
|
"Description": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "A brief description of the package."
|
||||||
|
},
|
||||||
|
"Source": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The source of the package (Registry, Embedded, Local, Git, etc.)."
|
||||||
|
},
|
||||||
|
"Category": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The category of the package."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": "Package information returned from package list operation."
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(AIGD.PackageData)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.PackageData",
|
||||||
|
"description": "Package information returned from package list operation."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
---
|
||||||
|
name: package-remove
|
||||||
|
description: Uninstall a UPM package from the Unity project. Modifies `manifest.json` and may trigger a domain reload — the final result is delivered after the reload via the request's `requestId`. Built-in packages and packages that are dependencies of others cannot be removed. Use 'package-list' to list installed packages first.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Package Manager / Remove
|
||||||
|
|
||||||
|
Remove (uninstall) a package from the Unity project. This removes the package from the project's manifest.json and triggers package resolution. Note: Built-in packages and packages that are dependencies of other installed packages cannot be removed. Note: Package removal may trigger a domain reload. The result will be sent after the reload completes. Use 'package-list' tool to list installed packages first.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `packageId` — package name (e.g. `com.unity.textmeshpro`). A trailing `@<version>` is stripped automatically before being passed to `Client.Remove`, so accidental versioned IDs still work.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
First verifies the package is installed via an offline `Client.List` — returns a clear `PackageNotFound` error if not. On removal failure, surfaces Unity's error message. On success, schedules a post-domain-reload notification so the response is delivered after Unity finishes the resolution.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool package-remove --input '{
|
||||||
|
"packageId": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool package-remove --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool package-remove --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `packageId` | `string` | Yes | The ID of the package to remove. Example: 'com.unity.textmeshpro'. Do not include version number. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"packageId": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"packageId"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
This tool does not return structured output.
|
||||||
|
|
||||||
@@ -0,0 +1,147 @@
|
|||||||
|
---
|
||||||
|
name: package-search
|
||||||
|
description: Search Unity's package registry plus locally installed packages (Git, local, embedded sources) by query string. Returns available versions and installation status. Online mode fetches exact matches from the live registry then supplements with cached substring matches.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Package Manager / Search
|
||||||
|
|
||||||
|
Search for packages in both Unity Package Manager registry and installed packages. Use this to find packages by name before installing them. Returns available versions and installation status. Searches both the Unity registry and locally installed packages (including Git, local, and embedded sources). Results are prioritized: exact name match, exact display name match, name substring, display name substring, description substring. Note: Online mode fetches exact matches from live registry, then supplements with cached substring matches.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `query` — package id, name, display name, or description keyword (case-insensitive). Required.
|
||||||
|
- `maxResults` (default 10) — caps the returned list.
|
||||||
|
- `offlineMode` (default `true`) — when `false`, hits the live registry for exact matches; cached registry data still backs the substring matches in both modes.
|
||||||
|
|
||||||
|
## Result composition
|
||||||
|
|
||||||
|
Each entry includes name, display name, latest version, truncated description, install status, installed version (if any), and the top-5 compatible versions.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool package-search --input '{
|
||||||
|
"query": "string_value",
|
||||||
|
"maxResults": 0,
|
||||||
|
"offlineMode": false
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool package-search --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool package-search --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `query` | `string` | Yes | The package id, name, or description. Can be: Full package id 'com.unity.textmeshpro', Full package name 'TextMesh Pro', Partial name 'TextMesh' (will search in Unity registry and installed packages), Description keyword 'rendering' (searches in package descriptions). |
|
||||||
|
| `maxResults` | `integer` | No | Maximum number of results to return. Default: 10 |
|
||||||
|
| `offlineMode` | `boolean` | No | Whether to perform the search in offline mode (uses cached registry data only). Default: true. Set to false to fetch latest exact matches from Unity registry. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"query": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"maxResults": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"offlineMode": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"query"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(AIGD.PackageSearchResult)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.PackageSearchResult": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The official Unity name of the package used as the package ID."
|
||||||
|
},
|
||||||
|
"DisplayName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The display name of the package."
|
||||||
|
},
|
||||||
|
"LatestVersion": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The latest version available in the registry."
|
||||||
|
},
|
||||||
|
"Description": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "A brief description of the package."
|
||||||
|
},
|
||||||
|
"IsInstalled": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether this package is already installed in the project."
|
||||||
|
},
|
||||||
|
"InstalledVersion": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The currently installed version (if installed)."
|
||||||
|
},
|
||||||
|
"AvailableVersions": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(System.String)",
|
||||||
|
"description": "Available versions of this package (up to 5 most recent)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"IsInstalled"
|
||||||
|
],
|
||||||
|
"description": "Package search result with available versions."
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(System.String)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(AIGD.PackageSearchResult)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.PackageSearchResult",
|
||||||
|
"description": "Package search result with available versions."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
---
|
||||||
|
name: ping
|
||||||
|
description: Lightweight readiness probe. Returns the input `message` echoed back, or `'pong'` when omitted. Useful for CLI health checks and SignalR connectivity smoke tests.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Ping
|
||||||
|
|
||||||
|
Lightweight readiness probe. Returns the input message or 'pong' if omitted.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `message` (optional) — when present, echoed back verbatim.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
No I/O, no Unity API calls — pure echo. Ideal for measuring round-trip latency or confirming the MCP transport is alive before invoking a heavier tool.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-system-tool ping --input '{
|
||||||
|
"message": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-system-tool ping --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-system-tool ping --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `message` | `string` | No | Optional message to echo back. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"message": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
---
|
||||||
|
name: profiler-capture-frame
|
||||||
|
description: Capture the current frame's timing info (delta time, FPS, frame counts, runtime). Snapshot only — historical frames live in Unity's Profiler window.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Profiler / Capture Frame
|
||||||
|
|
||||||
|
Reads `UnityEngine.Time` fields and returns them in a single struct. This tool is intentionally a single-frame snapshot — Unity's runtime API does not expose historical frame-data outside the Profiler window.
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
- `FrameTimeMs` — `Time.deltaTime * 1000f`.
|
||||||
|
- `Fps` — `1 / Time.deltaTime` (0 when delta is zero).
|
||||||
|
- `TotalFrameCount` — `Time.frameCount` (includes skipped renders).
|
||||||
|
- `RealtimeSinceStartup` — `Time.realtimeSinceStartup`.
|
||||||
|
- `RenderedFrameCount` — `Time.renderedFrameCount`.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Uses only built-in Unity APIs (`UnityEngine.Time`). No external Unity package is required.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool profiler-capture-frame --input '{
|
||||||
|
"nothing": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool profiler-capture-frame --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool profiler-capture-frame --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `nothing` | `string` | No | |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"nothing": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-FrameCaptureData",
|
||||||
|
"description": "Single-frame snapshot of timing information from UnityEngine.Time. No historical frame data; use the Profiler window for that."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-FrameCaptureData": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"FrameTimeMs": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Time.deltaTime in milliseconds at the moment of capture."
|
||||||
|
},
|
||||||
|
"Fps": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Frames per second derived from Time.deltaTime."
|
||||||
|
},
|
||||||
|
"TotalFrameCount": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Total frame count since application start (Time.frameCount). May include skipped renders."
|
||||||
|
},
|
||||||
|
"RealtimeSinceStartup": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Time.realtimeSinceStartup, in seconds."
|
||||||
|
},
|
||||||
|
"RenderedFrameCount": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Frames actually rendered (Time.renderedFrameCount)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"FrameTimeMs",
|
||||||
|
"Fps",
|
||||||
|
"TotalFrameCount",
|
||||||
|
"RealtimeSinceStartup",
|
||||||
|
"RenderedFrameCount"
|
||||||
|
],
|
||||||
|
"description": "Single-frame snapshot of timing information from UnityEngine.Time. No historical frame data; use the Profiler window for that."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
---
|
||||||
|
name: profiler-clear-data
|
||||||
|
description: Discard all frames currently held by the Editor Profiler (UnityEditorInternal.ProfilerDriver.ClearAllFrames). Cannot be undone.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Profiler / Clear Data
|
||||||
|
|
||||||
|
Invokes `UnityEditorInternal.ProfilerDriver.ClearAllFrames()` on the main thread. `UnityEditorInternal` is a built-in editor namespace — no external Unity package is required.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
After this call, the Profiler window's frame history is empty; subsequent recording starts from frame 0. Returns `true` on success.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool profiler-clear-data --input '{
|
||||||
|
"nothing": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool profiler-clear-data --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool profiler-clear-data --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `nothing` | `string` | No | |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"nothing": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
---
|
||||||
|
name: profiler-enable-module
|
||||||
|
description: Toggle the wrapper's local 'enabled' flag for a named profiler module. Bookkeeping only — Unity's runtime API does not expose direct module control; for real module visibility use the Profiler window.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Profiler / Enable Module
|
||||||
|
|
||||||
|
Adds or removes the given module name from the wrapper's `EnabledModules` set. This is local bookkeeping consumed by `profiler-get-status` and `profiler-list-modules`; Unity's runtime API does not allow programmatic toggling of Profiler-window modules from a built-in namespace, so this tool intentionally does not pretend to.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `moduleName` (required) — one of the names returned by `profiler-list-modules`.
|
||||||
|
- `enabled` (default `true`) — set to `false` to mark the module disabled.
|
||||||
|
|
||||||
|
## Errors
|
||||||
|
|
||||||
|
- Returns an `[Error]` string when `moduleName` is empty or unknown.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool profiler-enable-module --input '{
|
||||||
|
"moduleName": "string_value",
|
||||||
|
"enabled": false
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool profiler-enable-module --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool profiler-enable-module --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `moduleName` | `string` | Yes | Profiler module name (e.g. 'CPU', 'GPU', 'Memory'). |
|
||||||
|
| `enabled` | `boolean` | No | True to mark the module enabled in local bookkeeping; false to mark disabled. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"moduleName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"enabled": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"moduleName"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,144 @@
|
|||||||
|
---
|
||||||
|
name: profiler-get-memory-stats
|
||||||
|
description: Return memory statistics snapshot from UnityEngine.Profiling.Profiler — reserved, allocated, mono heap, graphics, etc. (in MB).
|
||||||
|
---
|
||||||
|
|
||||||
|
# Profiler / Get Memory Stats
|
||||||
|
|
||||||
|
Reads UnityEngine.Profiling.Profiler scalar memory counters and converts each from bytes to megabytes (`/1048576f`).
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
- `TotalReservedMemoryMB` — `GetTotalReservedMemoryLong()`.
|
||||||
|
- `TotalAllocatedMemoryMB` — `GetTotalAllocatedMemoryLong()`.
|
||||||
|
- `TotalUnusedReservedMemoryMB` — `GetTotalUnusedReservedMemoryLong()`.
|
||||||
|
- `MonoHeapSizeMB` — `GetMonoHeapSizeLong()`.
|
||||||
|
- `MonoUsedSizeMB` — `GetMonoUsedSizeLong()`.
|
||||||
|
- `TempAllocatorSizeMB` — `GetTempAllocatorSize()`.
|
||||||
|
- `GraphicsMemoryMB` — `GetAllocatedMemoryForGraphicsDriver()`.
|
||||||
|
- `MaxUsedMemoryMB` — `maxUsedMemory`.
|
||||||
|
- `UsedHeapSizeMB` — `usedHeapSizeLong`.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Uses only built-in Unity APIs (`UnityEngine.Profiling.Profiler`). No external Unity package is required.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool profiler-get-memory-stats --input '{
|
||||||
|
"nothing": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool profiler-get-memory-stats --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool profiler-get-memory-stats --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `nothing` | `string` | No | |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"nothing": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-MemoryStatsData",
|
||||||
|
"description": "Memory statistics from the Unity Profiler. All values in megabytes unless otherwise noted."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-MemoryStatsData": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"TotalReservedMemoryMB": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Total reserved memory (UnityEngine.Profiling.Profiler.GetTotalReservedMemoryLong / 1048576)."
|
||||||
|
},
|
||||||
|
"TotalAllocatedMemoryMB": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Total allocated memory (UnityEngine.Profiling.Profiler.GetTotalAllocatedMemoryLong / 1048576)."
|
||||||
|
},
|
||||||
|
"TotalUnusedReservedMemoryMB": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Total unused reserved memory (UnityEngine.Profiling.Profiler.GetTotalUnusedReservedMemoryLong / 1048576)."
|
||||||
|
},
|
||||||
|
"MonoHeapSizeMB": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Mono heap size (UnityEngine.Profiling.Profiler.GetMonoHeapSizeLong / 1048576)."
|
||||||
|
},
|
||||||
|
"MonoUsedSizeMB": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Mono used size (UnityEngine.Profiling.Profiler.GetMonoUsedSizeLong / 1048576)."
|
||||||
|
},
|
||||||
|
"TempAllocatorSizeMB": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Temp allocator size (UnityEngine.Profiling.Profiler.GetTempAllocatorSize / 1048576)."
|
||||||
|
},
|
||||||
|
"GraphicsMemoryMB": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Graphics memory reserved by the driver (UnityEngine.Profiling.Profiler.GetAllocatedMemoryForGraphicsDriver / 1048576)."
|
||||||
|
},
|
||||||
|
"MaxUsedMemoryMB": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Maximum used memory observed (UnityEngine.Profiling.Profiler.maxUsedMemory / 1048576)."
|
||||||
|
},
|
||||||
|
"UsedHeapSizeMB": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Used heap size (UnityEngine.Profiling.Profiler.usedHeapSizeLong / 1048576)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"TotalReservedMemoryMB",
|
||||||
|
"TotalAllocatedMemoryMB",
|
||||||
|
"TotalUnusedReservedMemoryMB",
|
||||||
|
"MonoHeapSizeMB",
|
||||||
|
"MonoUsedSizeMB",
|
||||||
|
"TempAllocatorSizeMB",
|
||||||
|
"GraphicsMemoryMB",
|
||||||
|
"MaxUsedMemoryMB",
|
||||||
|
"UsedHeapSizeMB"
|
||||||
|
],
|
||||||
|
"description": "Memory statistics from the Unity Profiler. All values in megabytes unless otherwise noted."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
---
|
||||||
|
name: profiler-get-rendering-stats
|
||||||
|
description: Return current frame timing, FPS, vsync, target frame rate, threading mode, and graphics device type from Unity Time / QualitySettings / SystemInfo.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Profiler / Get Rendering Stats
|
||||||
|
|
||||||
|
Snapshots rendering-related fields from `UnityEngine.Time`, `UnityEngine.QualitySettings`, `UnityEngine.Application` and `UnityEngine.SystemInfo`. All values are read from built-in Unity APIs so no external Unity package is required.
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
- `FrameTimeMs` — `Time.deltaTime * 1000f`.
|
||||||
|
- `Fps` — `1 / Time.deltaTime` (0 when delta is zero).
|
||||||
|
- `VSyncCount` — `QualitySettings.vSyncCount`.
|
||||||
|
- `TargetFrameRate` — `Application.targetFrameRate`.
|
||||||
|
- `RenderingThreadingMode` — `SystemInfo.renderingThreadingMode.ToString()`.
|
||||||
|
- `GraphicsDeviceType` — `SystemInfo.graphicsDeviceType.ToString()`.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool profiler-get-rendering-stats --input '{
|
||||||
|
"nothing": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool profiler-get-rendering-stats --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool profiler-get-rendering-stats --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `nothing` | `string` | No | |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"nothing": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-RenderingStatsData",
|
||||||
|
"description": "Rendering statistics from Unity's Time / QualitySettings / SystemInfo. No external package required."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-RenderingStatsData": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"FrameTimeMs": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Last reported frame time (Time.deltaTime * 1000) in milliseconds."
|
||||||
|
},
|
||||||
|
"Fps": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Frames per second derived from Time.deltaTime."
|
||||||
|
},
|
||||||
|
"VSyncCount": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "QualitySettings.vSyncCount."
|
||||||
|
},
|
||||||
|
"TargetFrameRate": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Application.targetFrameRate."
|
||||||
|
},
|
||||||
|
"RenderingThreadingMode": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "SystemInfo.renderingThreadingMode."
|
||||||
|
},
|
||||||
|
"GraphicsDeviceType": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "SystemInfo.graphicsDeviceType."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"FrameTimeMs",
|
||||||
|
"Fps",
|
||||||
|
"VSyncCount",
|
||||||
|
"TargetFrameRate"
|
||||||
|
],
|
||||||
|
"description": "Rendering statistics from Unity's Time / QualitySettings / SystemInfo. No external package required."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
---
|
||||||
|
name: profiler-get-script-stats
|
||||||
|
description: Return script execution timing (frame time, fixed dt, time scale, frame count, runtime) plus Mono / GC memory usage in MB.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Profiler / Get Script Stats
|
||||||
|
|
||||||
|
Snapshots fields from `UnityEngine.Time`, `UnityEngine.Profiling.Profiler.GetMonoUsedSizeLong()` and `System.GC.GetTotalMemory(false)`. All values are produced by built-in Unity APIs.
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
- `FrameTimeMs` — `Time.deltaTime * 1000f`.
|
||||||
|
- `FixedDeltaTimeMs` — `Time.fixedDeltaTime * 1000f`.
|
||||||
|
- `TimeScale` — `Time.timeScale`.
|
||||||
|
- `TotalFrameCount` — `Time.frameCount`.
|
||||||
|
- `RealtimeSinceStartup` — `Time.realtimeSinceStartup`.
|
||||||
|
- `MonoMemoryUsageMB` — `Profiler.GetMonoUsedSizeLong() / 1048576f`.
|
||||||
|
- `GCMemoryUsageMB` — `GC.GetTotalMemory(false) / 1048576f`.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool profiler-get-script-stats --input '{
|
||||||
|
"nothing": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool profiler-get-script-stats --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool profiler-get-script-stats --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `nothing` | `string` | No | |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"nothing": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-ScriptStatsData",
|
||||||
|
"description": "Script statistics derived from UnityEngine.Time + UnityEngine.Profiling.Profiler."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-ScriptStatsData": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"FrameTimeMs": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Time.deltaTime in milliseconds."
|
||||||
|
},
|
||||||
|
"FixedDeltaTimeMs": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Time.fixedDeltaTime in milliseconds."
|
||||||
|
},
|
||||||
|
"TimeScale": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Time.timeScale."
|
||||||
|
},
|
||||||
|
"TotalFrameCount": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Total frame count since application start (Time.frameCount)."
|
||||||
|
},
|
||||||
|
"RealtimeSinceStartup": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Time.realtimeSinceStartup, in seconds."
|
||||||
|
},
|
||||||
|
"MonoMemoryUsageMB": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Mono used size (Profiler.GetMonoUsedSizeLong / 1048576), in megabytes."
|
||||||
|
},
|
||||||
|
"GCMemoryUsageMB": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "System.GC.GetTotalMemory(false) / 1048576, in megabytes."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"FrameTimeMs",
|
||||||
|
"FixedDeltaTimeMs",
|
||||||
|
"TimeScale",
|
||||||
|
"TotalFrameCount",
|
||||||
|
"RealtimeSinceStartup",
|
||||||
|
"MonoMemoryUsageMB",
|
||||||
|
"GCMemoryUsageMB"
|
||||||
|
],
|
||||||
|
"description": "Script statistics derived from UnityEngine.Time + UnityEngine.Profiling.Profiler."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
---
|
||||||
|
name: profiler-get-status
|
||||||
|
description: Return the Unity profiler's current enabled state, active modules, max-used memory, and platform support flag. Read-only.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Profiler / Get Status
|
||||||
|
|
||||||
|
Snapshots `UnityEngine.Profiling.Profiler` state and returns it in a single response.
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
|
||||||
|
- `ProfilerEnabled` — `Profiler.enabled`.
|
||||||
|
- `ActiveModules` — names of modules this wrapper considers enabled (local bookkeeping).
|
||||||
|
- `MaxUsedMemoryMB` — `Profiler.maxUsedMemory / 1048576f`.
|
||||||
|
- `Supported` — `Profiler.supported`.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Uses only built-in Unity APIs. No external Unity package is required.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool profiler-get-status --input '{
|
||||||
|
"nothing": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool profiler-get-status --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool profiler-get-status --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `nothing` | `string` | No | |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"nothing": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-ProfilerStatusData",
|
||||||
|
"description": "Profiler status data including memory and module information."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Collections.Generic.List(System.String)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-ProfilerStatusData": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"ProfilerEnabled": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether Unity's runtime profiler is currently enabled (UnityEngine.Profiling.Profiler.enabled)."
|
||||||
|
},
|
||||||
|
"ActiveModules": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(System.String)",
|
||||||
|
"description": "List of profiler modules this wrapper considers active. Local bookkeeping only."
|
||||||
|
},
|
||||||
|
"MaxUsedMemoryMB": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Maximum used memory recorded by the profiler, in megabytes."
|
||||||
|
},
|
||||||
|
"Supported": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether profiling is supported on this platform (UnityEngine.Profiling.Profiler.supported)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"ProfilerEnabled",
|
||||||
|
"MaxUsedMemoryMB",
|
||||||
|
"Supported"
|
||||||
|
],
|
||||||
|
"description": "Profiler status data including memory and module information."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
---
|
||||||
|
name: profiler-list-modules
|
||||||
|
description: List all known profiler module names with their local 'enabled' bookkeeping flag.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Profiler / List Modules
|
||||||
|
|
||||||
|
Returns `Tool_Profiler.AvailableModules` projected into a `ProfilerModulesData` list, with each entry's `Enabled` field reflecting the wrapper's local bookkeeping.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Uses only built-in Unity APIs and in-process state. No external Unity package is required. Pair with `profiler-enable-module` to flip the bookkeeping flag.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool profiler-list-modules --input '{
|
||||||
|
"nothing": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool profiler-list-modules --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool profiler-list-modules --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `nothing` | `string` | No | |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"nothing": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-ProfilerModulesData",
|
||||||
|
"description": "Container for 'profiler-list-modules' output."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-ProfilerModuleInfo)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-ProfilerModuleInfo",
|
||||||
|
"description": "Profiler module entry returned by 'profiler-list-modules'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-ProfilerModuleInfo": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Module name (e.g. 'CPU', 'Memory')."
|
||||||
|
},
|
||||||
|
"Enabled": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether the wrapper considers this module enabled. Local bookkeeping only."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"Enabled"
|
||||||
|
],
|
||||||
|
"description": "Profiler module entry returned by 'profiler-list-modules'."
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-ProfilerModulesData": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Modules": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.Tool_Profiler-ProfilerModuleInfo)",
|
||||||
|
"description": "All known profiler modules and their wrapper-side enabled flag."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": "Container for 'profiler-list-modules' output."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
---
|
||||||
|
name: profiler-load-data
|
||||||
|
description: Read back a previously-saved JSON snapshot from `profiler-save-data` and return its raw text.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Profiler / Load Data
|
||||||
|
|
||||||
|
Reads `filePath` as UTF-8 text and returns the file body unchanged. Caller is responsible for parsing.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `filePath` (required) — path written by `profiler-save-data`.
|
||||||
|
|
||||||
|
## Errors
|
||||||
|
|
||||||
|
- Returns `[Error]` when `filePath` is empty, the file does not exist, exceeds the 10 MB size cap, or the read fails.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Uses `System.IO.File.ReadAllText` (BCL) — no external Unity package is required. Files larger than 10 MB are rejected up-front to avoid OOM on a stray call.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool profiler-load-data --input '{
|
||||||
|
"filePath": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool profiler-load-data --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool profiler-load-data --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `filePath` | `string` | Yes | Path to a profiler snapshot file previously written by 'profiler-save-data'. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"filePath": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"filePath"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
---
|
||||||
|
name: profiler-save-data
|
||||||
|
description: Save a snapshot of profiler-derived stats (status + memory + rendering + script + frame capture) to a JSON file. Built-in Unity APIs only.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Profiler / Save Data
|
||||||
|
|
||||||
|
Composes the outputs of `profiler-get-status`, `profiler-get-memory-stats`, `profiler-get-rendering-stats`, `profiler-get-script-stats` and `profiler-capture-frame` into a single JSON document and writes it to `filePath`. Creates any missing parent directories.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `filePath` (required) — absolute or workspace-relative path to write to.
|
||||||
|
|
||||||
|
## Errors
|
||||||
|
|
||||||
|
- Returns `[Error]` when `filePath` is empty or the write fails (message includes the underlying exception text).
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Uses `System.Text.Json` (BCL) for serialization and `System.IO.File.WriteAllText` for the write. No external Unity package is required.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool profiler-save-data --input '{
|
||||||
|
"filePath": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool profiler-save-data --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool profiler-save-data --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `filePath` | `string` | Yes | Absolute or workspace-relative output file path. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"filePath": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"filePath"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
---
|
||||||
|
name: profiler-start
|
||||||
|
description: "Enable Unity's runtime profiler and open the Profiler window. Idempotent: calling when already enabled returns the current enabled state without error."
|
||||||
|
---
|
||||||
|
|
||||||
|
# Profiler / Start
|
||||||
|
|
||||||
|
Enables `UnityEngine.Profiling.Profiler.enabled = true` and opens `Window > Analysis > Profiler` via `EditorApplication.ExecuteMenuItem`. Returns `true` once the profiler is enabled.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Uses only built-in Unity APIs (`UnityEngine.Profiling`, `UnityEditor.EditorApplication`). No external Unity package is required.
|
||||||
|
|
||||||
|
Snapshot-based: this tool does not stream historical frame data — use Unity's Profiler window directly for that.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool profiler-start --input '{
|
||||||
|
"nothing": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool profiler-start --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool profiler-start --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `nothing` | `string` | No | |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"nothing": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
---
|
||||||
|
name: profiler-stop
|
||||||
|
description: Disable Unity's runtime profiler. Idempotent — calling when already disabled returns the current disabled state.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Profiler / Stop
|
||||||
|
|
||||||
|
Sets `UnityEngine.Profiling.Profiler.enabled = false`. Returns the post-call value of `Profiler.enabled` (expected `false`).
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Uses only built-in Unity APIs (`UnityEngine.Profiling`). No external Unity package is required.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool profiler-stop --input '{
|
||||||
|
"nothing": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool profiler-stop --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool profiler-stop --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `nothing` | `string` | No | |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"nothing": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,252 @@
|
|||||||
|
---
|
||||||
|
name: reflection-method-call
|
||||||
|
description: Call a C# method by reflection — including private methods. Requires a method schema obtained via 'reflection-method-find'. Supports static methods, instance methods (with optional target deserialization), and main-thread / off-thread execution.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Method C# / Call
|
||||||
|
|
||||||
|
Call C# method. Any method could be called, even private methods. It requires to receive proper method schema. Use 'reflection-method-find' to find available method before using it. Receives input parameters and returns result.
|
||||||
|
|
||||||
|
## Match levels (apply to `typeName`, `MethodName`, `Parameters`)
|
||||||
|
|
||||||
|
- `typeNameMatchLevel` / `methodNameMatchLevel` (default 1 — contains ignoring case): `0` ignore filter, `1` contains-ic, `2` contains-cs, `3` starts-with-ic, `4` starts-with-cs, `5` equals-ic, `6` equals-cs.
|
||||||
|
- `parametersMatchLevel` (default 2 — equals): `0` ignore filter, `1` count matches, `2` equals.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `targetObject` (optional) — for instance methods. When null, a new instance is created from the declaring type. Required shape: `{ type, value }` (value is deserialized to `type`).
|
||||||
|
- `inputParameters` (optional) — list of `{ type, name, value }`. Names are enhanced against the resolved method signature if omitted.
|
||||||
|
- `executeInMainThread` (default `true`) — Unity API calls should keep this true; set false only for thread-safe pure logic.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool reflection-method-call --input '{
|
||||||
|
"filter": "string_value",
|
||||||
|
"knownNamespace": false,
|
||||||
|
"typeNameMatchLevel": 0,
|
||||||
|
"methodNameMatchLevel": 0,
|
||||||
|
"parametersMatchLevel": 0,
|
||||||
|
"targetObject": "string_value",
|
||||||
|
"inputParameters": "string_value",
|
||||||
|
"executeInMainThread": false
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool reflection-method-call --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool reflection-method-call --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `filter` | `any` | Yes | Method reference. Used to find method in codebase of the project. |
|
||||||
|
| `knownNamespace` | `boolean` | No | Set to true if 'Namespace' is known and full namespace name is specified in the 'filter.Namespace' property. Otherwise, set to false. |
|
||||||
|
| `typeNameMatchLevel` | `integer` | No | Minimal match level for 'typeName'. 0 - ignore 'filter.typeName', 1 - contains ignoring case (default value), 2 - contains case sensitive, 3 - starts with ignoring case, 4 - starts with case sensitive, 5 - equals ignoring case, 6 - equals case sensitive. |
|
||||||
|
| `methodNameMatchLevel` | `integer` | No | Minimal match level for 'MethodName'. 0 - ignore 'filter.MethodName', 1 - contains ignoring case (default value), 2 - contains case sensitive, 3 - starts with ignoring case, 4 - starts with case sensitive, 5 - equals ignoring case, 6 - equals case sensitive. |
|
||||||
|
| `parametersMatchLevel` | `integer` | No | Minimal match level for 'Parameters'. 0 - ignore 'filter.Parameters', 1 - parameters count is the same, 2 - equals (default value). |
|
||||||
|
| `targetObject` | `any` | No | Specify target object to call method on. Should be null if the method is static or if there is no specific target instance. New instance of the specified class will be created if the method is instance method and the targetObject is null. Required: type - full type name of the object to call method on, value - serialized object value (it will be deserialized to the specified type). |
|
||||||
|
| `inputParameters` | `any` | No | Method input parameters. Per each parameter specify: type - full type name of the object to call method on, name - parameter name, value - serialized object value (it will be deserialized to the specified type). |
|
||||||
|
| `executeInMainThread` | `boolean` | No | Set to true if the method should be executed in the main thread. Otherwise, set to false. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"filter": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.MethodRef"
|
||||||
|
},
|
||||||
|
"knownNamespace": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"typeNameMatchLevel": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"methodNameMatchLevel": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"parametersMatchLevel": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"targetObject": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember"
|
||||||
|
},
|
||||||
|
"inputParameters": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMemberList"
|
||||||
|
},
|
||||||
|
"executeInMainThread": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Collections.Generic.List(com.IvanMurzak.ReflectorNet.Model.MethodRef-Parameter)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.MethodRef-Parameter",
|
||||||
|
"description": "Parameter of a method. Contains type and name of the parameter."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.MethodRef-Parameter": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Type of the parameter including namespace. Sample: 'System.String', 'System.Int32', 'UnityEngine.GameObject', etc."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of the parameter. It may be empty if the name is unknown."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": "Parameter of a method. Contains type and name of the parameter."
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.MethodRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"namespace": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Namespace of the class. It may be empty if the class is in the global namespace or the namespace is unknown."
|
||||||
|
},
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Class name, or substring a class name. It may be empty if the class is unknown."
|
||||||
|
},
|
||||||
|
"methodName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Method name, or substring of the method name. It may be empty if the method is unknown."
|
||||||
|
},
|
||||||
|
"inputParameters": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.ReflectorNet.Model.MethodRef-Parameter)",
|
||||||
|
"description": "List of input parameters. Can be null if the method has no parameters or the parameters are unknown."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": "Method reference. Used to find method in codebase of the project."
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMember": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Object name."
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json."
|
||||||
|
},
|
||||||
|
"fields": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested field value."
|
||||||
|
},
|
||||||
|
"description": "Fields of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
},
|
||||||
|
"props": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested property value."
|
||||||
|
},
|
||||||
|
"description": "Properties of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"typeName"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"filter"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMember": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Object name."
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json."
|
||||||
|
},
|
||||||
|
"fields": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested field value."
|
||||||
|
},
|
||||||
|
"description": "Fields of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
},
|
||||||
|
"props": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested property value."
|
||||||
|
},
|
||||||
|
"description": "Properties of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"typeName"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,149 @@
|
|||||||
|
---
|
||||||
|
name: reflection-method-find
|
||||||
|
description: Find C# methods across every loaded assembly by name / type / parameters — including private methods. Returns serialized `MethodData` entries usable as schemas for 'reflection-method-call'.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Method C# / Find
|
||||||
|
|
||||||
|
Find method in the project using C# Reflection. It looks for all assemblies in the project and finds method by its name, class name and parameters. Even private methods are available. Use 'reflection-method-call' to call the method after finding it.
|
||||||
|
|
||||||
|
## Match levels (apply to `typeName`, `MethodName`, `Parameters`)
|
||||||
|
|
||||||
|
- `typeNameMatchLevel` / `methodNameMatchLevel` (default 1 — contains ignoring case): `0` ignore filter, `1` contains-ic, `2` contains-cs, `3` starts-with-ic, `4` starts-with-cs, `5` equals-ic, `6` equals-cs.
|
||||||
|
- `parametersMatchLevel` (default 0 — ignore filter): `0` ignore, `1` count matches, `2` equals.
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
On match, returns a `[Success] Found N method(s):` line followed by a JSON dump of every method's `MethodData`. Pass any single entry to 'reflection-method-call' as its `filter`.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool reflection-method-find --input '{
|
||||||
|
"filter": "string_value",
|
||||||
|
"knownNamespace": false,
|
||||||
|
"typeNameMatchLevel": 0,
|
||||||
|
"methodNameMatchLevel": 0,
|
||||||
|
"parametersMatchLevel": 0
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool reflection-method-find --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool reflection-method-find --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `filter` | `any` | Yes | Method reference. Used to find method in codebase of the project. |
|
||||||
|
| `knownNamespace` | `boolean` | No | Set to true if 'Namespace' is known and full namespace name is specified in the 'filter.Namespace' property. Otherwise, set to false. |
|
||||||
|
| `typeNameMatchLevel` | `integer` | No | Minimal match level for 'typeName'. 0 - ignore 'filter.typeName', 1 - contains ignoring case (default value), 2 - contains case sensitive, 3 - starts with ignoring case, 4 - starts with case sensitive, 5 - equals ignoring case, 6 - equals case sensitive. |
|
||||||
|
| `methodNameMatchLevel` | `integer` | No | Minimal match level for 'MethodName'. 0 - ignore 'filter.MethodName', 1 - contains ignoring case (default value), 2 - contains case sensitive, 3 - starts with ignoring case, 4 - starts with case sensitive, 5 - equals ignoring case, 6 - equals case sensitive. |
|
||||||
|
| `parametersMatchLevel` | `integer` | No | Minimal match level for 'Parameters'. 0 - ignore 'filter.Parameters' (default value), 1 - parameters count is the same, 2 - equals. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"filter": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.MethodRef"
|
||||||
|
},
|
||||||
|
"knownNamespace": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"typeNameMatchLevel": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"methodNameMatchLevel": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"parametersMatchLevel": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Collections.Generic.List(com.IvanMurzak.ReflectorNet.Model.MethodRef-Parameter)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.MethodRef-Parameter",
|
||||||
|
"description": "Parameter of a method. Contains type and name of the parameter."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.MethodRef-Parameter": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Type of the parameter including namespace. Sample: 'System.String', 'System.Int32', 'UnityEngine.GameObject', etc."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of the parameter. It may be empty if the name is unknown."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": "Parameter of a method. Contains type and name of the parameter."
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.MethodRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"namespace": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Namespace of the class. It may be empty if the class is in the global namespace or the namespace is unknown."
|
||||||
|
},
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Class name, or substring a class name. It may be empty if the class is unknown."
|
||||||
|
},
|
||||||
|
"methodName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Method name, or substring of the method name. It may be empty if the method is unknown."
|
||||||
|
},
|
||||||
|
"inputParameters": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.ReflectorNet.Model.MethodRef-Parameter)",
|
||||||
|
"description": "List of input parameters. Can be null if the method has no parameters or the parameters are unknown."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": "Method reference. Used to find method in codebase of the project."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"filter"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,160 @@
|
|||||||
|
---
|
||||||
|
name: scene-create
|
||||||
|
description: Create a new Unity scene asset and save it at the given `.unity` path. Use 'scene-list-opened' to inspect the resulting opened-scene set afterwards.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Scene / Create
|
||||||
|
|
||||||
|
Create new scene in the project assets. Use 'scene-list-opened' tool to list all opened scenes after creation.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `path` — must end with `.unity`. Non-empty.
|
||||||
|
- `newSceneSetup` (default `DefaultGameObjects`) — Unity's `NewSceneSetup` flag (`EmptyScene` or `DefaultGameObjects`).
|
||||||
|
- `newSceneMode` (default `Single`) — `Single` closes other scenes, `Additive` keeps them open.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Calls `EditorSceneManager.NewScene` + `SaveScene(path)` on the main thread, repaints editor windows, and returns a `SceneDataShallow` for the newly created scene.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool scene-create --input '{
|
||||||
|
"path": "string_value",
|
||||||
|
"newSceneSetup": "string_value",
|
||||||
|
"newSceneMode": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool scene-create --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool scene-create --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `path` | `string` | Yes | Path to the scene file. Should end with ".unity" extension. |
|
||||||
|
| `newSceneSetup` | `any` | No | |
|
||||||
|
| `newSceneMode` | `any` | No | |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"path": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"newSceneSetup": {
|
||||||
|
"$ref": "#/$defs/UnityEditor.SceneManagement.NewSceneSetup"
|
||||||
|
},
|
||||||
|
"newSceneMode": {
|
||||||
|
"$ref": "#/$defs/UnityEditor.SceneManagement.NewSceneMode"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"UnityEditor.SceneManagement.NewSceneSetup": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"EmptyScene",
|
||||||
|
"DefaultGameObjects"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"UnityEditor.SceneManagement.NewSceneMode": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"Single",
|
||||||
|
"Additive"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"path"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.SceneDataShallow",
|
||||||
|
"description": "Scene reference. Used to find a Scene."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.SceneDataShallow": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"IsLoaded": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"IsDirty": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"IsSubScene": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"IsValidScene": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether this is a valid Scene. A Scene may be invalid if, for example, you tried to open a Scene that does not exist. In this case, the Scene returned from EditorSceneManager.OpenScene would return False for IsValid."
|
||||||
|
},
|
||||||
|
"RootCount": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the Scene within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"buildIndex": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Build index of the Scene in the Build Settings."
|
||||||
|
},
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"IsLoaded",
|
||||||
|
"IsDirty",
|
||||||
|
"IsSubScene",
|
||||||
|
"IsValidScene",
|
||||||
|
"RootCount",
|
||||||
|
"buildIndex",
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Scene reference. Used to find a Scene."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,431 @@
|
|||||||
|
---
|
||||||
|
name: scene-get-data
|
||||||
|
description: Retrieve the list of root GameObjects in the specified opened scene (or the active scene when `openedSceneName` is empty). Supports token-saving path-scoped reads over the root-GameObjects array via `paths` or `viewQuery`. Use 'scene-list-opened' to enumerate scenes.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Scene / Get Data
|
||||||
|
|
||||||
|
This tool retrieves the list of root GameObjects in the specified scene. Use 'scene-list-opened' tool to get the list of all opened scenes.
|
||||||
|
|
||||||
|
## Toggles (all default `false` to keep responses small)
|
||||||
|
|
||||||
|
- `includeRootGameObjects` — include root GameObjects in the scene data.
|
||||||
|
- `includeChildrenDepth` (default 3) — depth of the hierarchy to include.
|
||||||
|
- `includeBounds` — include 3D bounds for GameObjects.
|
||||||
|
- `includeData` — include serialized component data for GameObjects.
|
||||||
|
|
||||||
|
## Path-scoped reads (token-saving)
|
||||||
|
|
||||||
|
Supply `paths` to read only the listed fields/elements from the scene's root-GameObjects array via `Reflector.TryReadAt`, or `viewQuery` to navigate/filter the same array via `Reflector.View`. The result populates `Data` on the returned `SceneData`. These two parameters are mutually exclusive.
|
||||||
|
|
||||||
|
## Path syntax
|
||||||
|
|
||||||
|
`fieldName`, `nested/field`, `arrayField/[i]`, `dictField/[key]`. Leading `#/` is stripped. Example: `paths=['[0]/name']` reads the name of the first root GameObject.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool scene-get-data --input '{
|
||||||
|
"openedSceneName": "string_value",
|
||||||
|
"includeRootGameObjects": false,
|
||||||
|
"includeChildrenDepth": 0,
|
||||||
|
"includeBounds": false,
|
||||||
|
"includeData": false,
|
||||||
|
"paths": "string_value",
|
||||||
|
"viewQuery": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool scene-get-data --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool scene-get-data --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `openedSceneName` | `string` | No | Name of the opened scene. If empty or null, the active scene will be used. |
|
||||||
|
| `includeRootGameObjects` | `boolean` | No | If true, includes root GameObjects in the scene data. |
|
||||||
|
| `includeChildrenDepth` | `integer` | No | Determines the depth of the hierarchy to include. |
|
||||||
|
| `includeBounds` | `boolean` | No | If true, includes bounding box information for GameObjects. |
|
||||||
|
| `includeData` | `boolean` | No | If true, includes component data for GameObjects. |
|
||||||
|
| `paths` | `any` | No | Optional. List of paths to read individually via Reflector.TryReadAt against the scene's root-GameObjects array. Path syntax: 'fieldName', '[i]/field', '[i]/component/[j]/property'. Mutually exclusive with 'viewQuery'. |
|
||||||
|
| `viewQuery` | `any` | No | Optional. View-query filter routed through Reflector.View on the scene's root-GameObjects array. Mutually exclusive with 'paths'. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"openedSceneName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"includeRootGameObjects": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"includeChildrenDepth": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"includeBounds": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"includeData": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"paths": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(System.String)"
|
||||||
|
},
|
||||||
|
"viewQuery": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.ViewQuery"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Collections.Generic.List(System.String)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.ViewQuery": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Navigate to this path first, then serialize only that subtree. Path segments are separated by '/'. Use '[i]' for array/list index (e.g. 'users/[2]/name') and '[key]' for dictionary entry (e.g. 'config/[timeout]'). A leading '#/' is stripped automatically. Examples: 'admin/name', 'users/[0]/email', 'config/[timeout]'. Leave null to start from the root object."
|
||||||
|
},
|
||||||
|
"NamePattern": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Case-insensitive .NET regex pattern matched against field and property names. Only branches containing at least one match are kept in the result tree. Examples: 'orbitRadius' (exact name), 'orbit.*' (prefix match), 'radius|speed' (either name). When nothing matches, the root envelope is returned with empty fields/props. Leave null to return all fields and properties without filtering."
|
||||||
|
},
|
||||||
|
"MaxDepth": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Maximum nesting depth of the returned serialized tree. 0 = root type name and value only — no nested fields or properties. 1 = one level of fields/props visible, their children stripped. 2 = two levels visible, and so on. Leave null (default) for unlimited depth."
|
||||||
|
},
|
||||||
|
"TypeFilter": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "When set, prunes the result tree to members whose runtime type is assignable to this type. Non-matching branches are removed; the root envelope is always preserved. Examples: typeof(float) keeps only float fields, typeof(IEnumerable) keeps only collections. Leave null to include members of any type."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.SceneData",
|
||||||
|
"description": "Scene reference. Used to find a Scene."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Collections.Generic.List(AIGD.GameObjectData)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectData"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.GameObjectData": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Reference": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef",
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
},
|
||||||
|
"Data": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "GameObject editable data (tag, layer, etc)."
|
||||||
|
},
|
||||||
|
"Bounds": {
|
||||||
|
"$ref": "#/$defs/UnityEngine.Bounds",
|
||||||
|
"description": "Bounds of the GameObject."
|
||||||
|
},
|
||||||
|
"Hierarchy": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectMetadata",
|
||||||
|
"description": "Hierarchy metadata of the GameObject."
|
||||||
|
},
|
||||||
|
"Components": {
|
||||||
|
"$ref": "#/$defs/AIGD.ComponentDataShallow-1",
|
||||||
|
"description": "Attached components shallow data of the GameObject (Read-only, use Component modification tool for modification)."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.GameObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of a GameObject in hierarchy. Priority: 3."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
},
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMember": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Object name."
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json."
|
||||||
|
},
|
||||||
|
"fields": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested field value."
|
||||||
|
},
|
||||||
|
"description": "Fields of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
},
|
||||||
|
"props": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested property value."
|
||||||
|
},
|
||||||
|
"description": "Properties of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"typeName"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"UnityEngine.Bounds": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"center": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"x": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"y": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"z": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"x",
|
||||||
|
"y",
|
||||||
|
"z"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"size": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"x": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"y": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"z": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"x",
|
||||||
|
"y",
|
||||||
|
"z"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"center",
|
||||||
|
"size"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
"AIGD.GameObjectMetadata": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"sceneName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"tag": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"activeSelf": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"activeInHierarchy": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"children": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(AIGD.GameObjectMetadata)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID",
|
||||||
|
"activeSelf",
|
||||||
|
"activeInHierarchy"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(AIGD.GameObjectMetadata)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectMetadata"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.ComponentDataShallow-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.ComponentDataShallow"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.ComponentDataShallow": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"typeName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"isEnabled": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"False",
|
||||||
|
"True",
|
||||||
|
"NA"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID",
|
||||||
|
"isEnabled"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"AIGD.SceneData": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"RootGameObjects": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(AIGD.GameObjectData)"
|
||||||
|
},
|
||||||
|
"Data": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Path-scoped read or view-query result, populated when 'paths' or 'viewQuery' is supplied to the scene-get-data tool. Null otherwise."
|
||||||
|
},
|
||||||
|
"Name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"IsLoaded": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"IsDirty": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"IsSubScene": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"IsValidScene": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether this is a valid Scene. A Scene may be invalid if, for example, you tried to open a Scene that does not exist. In this case, the Scene returned from EditorSceneManager.OpenScene would return False for IsValid."
|
||||||
|
},
|
||||||
|
"RootCount": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the Scene within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"buildIndex": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Build index of the Scene in the Build Settings."
|
||||||
|
},
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"IsLoaded",
|
||||||
|
"IsDirty",
|
||||||
|
"IsSubScene",
|
||||||
|
"IsValidScene",
|
||||||
|
"RootCount",
|
||||||
|
"buildIndex",
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Scene reference. Used to find a Scene."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,131 @@
|
|||||||
|
---
|
||||||
|
name: scene-list-opened
|
||||||
|
description: List every scene currently opened in the Unity Editor as a shallow snapshot (name, path, build flags). Use 'scene-get-data' for the deep view of a specific scene.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Scene / List Opened
|
||||||
|
|
||||||
|
Returns the list of currently opened scenes in Unity Editor. Use 'scene-get-data' tool to get detailed information about a specific scene.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Maps `OpenedScenes` through `ToSceneDataShallow()` on the main thread and returns the resulting array. No filtering or pagination — every opened scene is included.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool scene-list-opened --input '{
|
||||||
|
"nothing": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool scene-list-opened --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool scene-list-opened --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `nothing` | `string` | No | |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"nothing": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.SceneDataShallow-1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.SceneDataShallow": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"IsLoaded": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"IsDirty": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"IsSubScene": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"IsValidScene": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether this is a valid Scene. A Scene may be invalid if, for example, you tried to open a Scene that does not exist. In this case, the Scene returned from EditorSceneManager.OpenScene would return False for IsValid."
|
||||||
|
},
|
||||||
|
"RootCount": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the Scene within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"buildIndex": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Build index of the Scene in the Build Settings."
|
||||||
|
},
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"IsLoaded",
|
||||||
|
"IsDirty",
|
||||||
|
"IsSubScene",
|
||||||
|
"IsValidScene",
|
||||||
|
"RootCount",
|
||||||
|
"buildIndex",
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Scene reference. Used to find a Scene."
|
||||||
|
},
|
||||||
|
"AIGD.SceneDataShallow-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.SceneDataShallow",
|
||||||
|
"description": "Scene reference. Used to find a Scene."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,177 @@
|
|||||||
|
---
|
||||||
|
name: scene-open
|
||||||
|
description: Open a Unity scene asset in Single or Additive mode. Returns the post-open list of all opened scenes. Use 'assets-find' to locate the scene asset first.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Scene / Open
|
||||||
|
|
||||||
|
Open scene from the project asset file. Use 'assets-find' tool to find the scene asset first.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `sceneRef` — `AssetObjectRef` pointing at a `SceneAsset`. Throws if the asset cannot be resolved or is not a `SceneAsset`.
|
||||||
|
- `loadSceneMode` (default `Single`):
|
||||||
|
- `Single` — closes the currently opened scenes and opens this one.
|
||||||
|
- `Additive` — keeps the currently opened scenes and opens this one alongside them.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool scene-open --input '{
|
||||||
|
"sceneRef": "string_value",
|
||||||
|
"loadSceneMode": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool scene-open --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool scene-open --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `sceneRef` | `any` | Yes | Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders. |
|
||||||
|
| `loadSceneMode` | `string` | No | Open scene mode. Single: closes the current scenes and opens a new one. Additive: keeps the current scene and opens additional one. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"sceneRef": {
|
||||||
|
"$ref": "#/$defs/AIGD.AssetObjectRef"
|
||||||
|
},
|
||||||
|
"loadSceneMode": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"Single",
|
||||||
|
"Additive",
|
||||||
|
"AdditiveWithoutLoading"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.AssetObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"sceneRef"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.SceneDataShallow-1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.SceneDataShallow": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"IsLoaded": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"IsDirty": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"IsSubScene": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"IsValidScene": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether this is a valid Scene. A Scene may be invalid if, for example, you tried to open a Scene that does not exist. In this case, the Scene returned from EditorSceneManager.OpenScene would return False for IsValid."
|
||||||
|
},
|
||||||
|
"RootCount": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the Scene within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"buildIndex": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Build index of the Scene in the Build Settings."
|
||||||
|
},
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"IsLoaded",
|
||||||
|
"IsDirty",
|
||||||
|
"IsSubScene",
|
||||||
|
"IsValidScene",
|
||||||
|
"RootCount",
|
||||||
|
"buildIndex",
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Scene reference. Used to find a Scene."
|
||||||
|
},
|
||||||
|
"AIGD.SceneDataShallow-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.SceneDataShallow",
|
||||||
|
"description": "Scene reference. Used to find a Scene."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
---
|
||||||
|
name: scene-save
|
||||||
|
description: Save an opened scene back to its asset file (or to a new path when `path` is provided). When `openedSceneName` is empty, saves the currently active scene. Use 'scene-list-opened' to find the scene name first.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Scene / Save
|
||||||
|
|
||||||
|
Save Opened scene to the asset file. Use 'scene-list-opened' tool to get the list of all opened scenes.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `openedSceneName` (optional) — name of an opened scene to save. Empty/null = active scene.
|
||||||
|
- `path` (optional) — destination `.unity` path. Empty/null = save back to the scene's existing path.
|
||||||
|
|
||||||
|
## Validation
|
||||||
|
|
||||||
|
Throws if the scene cannot be resolved, has no existing path AND no override path was supplied, or the supplied path does not end with `.unity`. On `EditorSceneManager.SaveScene` failure, surfaces an error with the current opened-scenes list for diagnosis.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool scene-save --input '{
|
||||||
|
"openedSceneName": "string_value",
|
||||||
|
"path": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool scene-save --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool scene-save --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `openedSceneName` | `string` | No | Name of the opened scene that should be saved. Could be empty if need to save the current active scene. |
|
||||||
|
| `path` | `string` | No | Path to the scene file. Should end with ".unity". If null or empty save to the existed scene asset file. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"openedSceneName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
This tool does not return structured output.
|
||||||
|
|
||||||
@@ -0,0 +1,168 @@
|
|||||||
|
---
|
||||||
|
name: scene-set-active
|
||||||
|
description: Mark an opened scene as the Editor's active scene (the one new GameObjects are added to and that's used as the default for many operations). Use 'scene-list-opened' to enumerate opened scenes first.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Scene / Set Active
|
||||||
|
|
||||||
|
Set the specified opened scene as the active scene. Use 'scene-list-opened' tool to get the list of all opened scenes.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `sceneRef` — `AssetObjectRef` pointing at a `SceneAsset`. The scene must already be opened.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Resolves the `SceneAsset`, finds the matching opened scene (by name then by path), and calls `EditorSceneManager.SetActiveScene`. No-op if the scene is already active. Returns the post-call snapshot of opened scenes.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool scene-set-active --input '{
|
||||||
|
"sceneRef": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool scene-set-active --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool scene-set-active --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `sceneRef` | `any` | Yes | Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"sceneRef": {
|
||||||
|
"$ref": "#/$defs/AIGD.AssetObjectRef"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.AssetObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"sceneRef"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.SceneDataShallow-1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.SceneDataShallow": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"IsLoaded": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"IsDirty": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"IsSubScene": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"IsValidScene": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether this is a valid Scene. A Scene may be invalid if, for example, you tried to open a Scene that does not exist. In this case, the Scene returned from EditorSceneManager.OpenScene would return False for IsValid."
|
||||||
|
},
|
||||||
|
"RootCount": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the Scene within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"buildIndex": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Build index of the Scene in the Build Settings."
|
||||||
|
},
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0', then it will be used as 'null'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"IsLoaded",
|
||||||
|
"IsDirty",
|
||||||
|
"IsSubScene",
|
||||||
|
"IsValidScene",
|
||||||
|
"RootCount",
|
||||||
|
"buildIndex",
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Scene reference. Used to find a Scene."
|
||||||
|
},
|
||||||
|
"AIGD.SceneDataShallow-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.SceneDataShallow",
|
||||||
|
"description": "Scene reference. Used to find a Scene."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,126 @@
|
|||||||
|
---
|
||||||
|
name: scene-unload
|
||||||
|
description: Unload an opened scene from the Unity Editor (asynchronously via `SceneManager.UnloadSceneAsync`). Use 'scene-list-opened' to find the scene name first.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Scene / Unload
|
||||||
|
|
||||||
|
Unload scene from the Opened scenes in Unity Editor. Use 'scene-list-opened' tool to get the list of all opened scenes.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `name` — required non-empty scene name. Must match an opened scene; otherwise throws.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Runs `SceneManager.UnloadSceneAsync` on the main thread and awaits completion. Returns an `UnloadSceneResult` containing the scene name and an `AssetObjectRef` to its asset (or `null` if the scene was not backed by an asset on disk).
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool scene-unload --input '{
|
||||||
|
"name": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool scene-unload --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool scene-unload --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `name` | `string` | Yes | Name of the loaded scene. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"name"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.UnloadSceneResult"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.AssetObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If this is '0' and 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Reference to UnityEngine.Object asset instance. It could be Material, ScriptableObject, Prefab, and any other Asset. Anything located in the Assets and Packages folders."
|
||||||
|
},
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.UnloadSceneResult": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of the unloaded scene."
|
||||||
|
},
|
||||||
|
"AssetObjectRef": {
|
||||||
|
"$ref": "#/$defs/AIGD.AssetObjectRef",
|
||||||
|
"description": "Reference to the unloaded scene asset."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
---
|
||||||
|
name: screenshot-camera
|
||||||
|
description: Capture a screenshot from a Unity `Camera` and return it as a PNG image for direct LLM inspection. Falls back to `Camera.main` (then any active camera) when `cameraRef` is null. Width and height are capped to keep response size manageable.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Screenshot / Camera
|
||||||
|
|
||||||
|
Captures a screenshot from a camera and returns it as an image. If no camera is specified, uses the Main Camera. Returns the image directly for visual inspection by the LLM.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `cameraRef` (optional) — reference to a GameObject hosting a `Camera`. When null, `Camera.main` is used; if there is no main camera, the first entry of `Camera.allCameras` is used.
|
||||||
|
- `width` (default 1920) / `height` (default 1080) — output pixels. Must be > 0 and ≤ `MaxDimension`.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Allocates a temporary `RenderTexture`, swaps it onto the chosen camera, calls `Camera.Render`, reads back via `Texture2D.ReadPixels`, encodes as PNG, and restores the camera's prior `targetTexture`. Returns a `ResponseCallTool.Image` with `image/png` MIME and a descriptive caption.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool screenshot-camera --input '{
|
||||||
|
"cameraRef": "string_value",
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool screenshot-camera --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool screenshot-camera --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `cameraRef` | `any` | No | Reference to the camera GameObject. If not specified, uses the Main Camera. |
|
||||||
|
| `width` | `integer` | No | Width of the screenshot in pixels. |
|
||||||
|
| `height` | `integer` | No | Height of the screenshot in pixels. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"cameraRef": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef"
|
||||||
|
},
|
||||||
|
"width": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"height": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.GameObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of a GameObject in hierarchy. Priority: 3."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
This tool does not return structured output.
|
||||||
|
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
---
|
||||||
|
name: screenshot-game-view
|
||||||
|
description: Capture a screenshot of the Unity Editor's Game View by reading its internal render texture directly. Image size matches the current Game View resolution; the tool corrects Y-flip on DirectX / Metal so the output is always upright. Requires an open Game View window.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Screenshot / Game View
|
||||||
|
|
||||||
|
Captures a screenshot from the Unity Editor Game View and returns it as an image. Reads the Game View's own render texture directly via the Unity Editor API. The image size matches the current Game View resolution. Returns the image directly for visual inspection by the LLM.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Locates `UnityEditor.GameView`, repaints it, then reflects the `m_RenderTexture` field and reads back via `Texture2D.ReadPixels`. On graphics APIs whose UV origin is top-left (`SystemInfo.graphicsUVStartsAtTop`), the read-back pixels are vertically flipped before encoding so the orientation matches what the user sees. Returns a PNG image with the resolution baked into the caption.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool screenshot-game-view --input '{
|
||||||
|
"nothing": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool screenshot-game-view --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool screenshot-game-view --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `nothing` | `string` | No | |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"nothing": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
This tool does not return structured output.
|
||||||
|
|
||||||
@@ -0,0 +1,201 @@
|
|||||||
|
---
|
||||||
|
name: screenshot-isolated
|
||||||
|
description: Render a target GameObject from a chosen camera angle with optional layer-based isolation, configurable background (solid/skybox/transparent), multi-light setup via JSON, and Composite (2x2 Front/Right/Back/Top) mode. Returns a PNG image. When isolated=true, inactive children may briefly fire OnEnable — see the body for side-effect notes.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Screenshot / Isolated GameObject
|
||||||
|
|
||||||
|
Renders a screenshot of a target GameObject with configurable isolation, background, camera angle, and lighting. When isolated=true (default), only the target object is visible via layer-based culling and inactive children of the target are temporarily activated for the render (their OnEnable callbacks may fire — restored in finally, but side effects like audio/network/animation events are not undoable). When isolated=false, the existing scene state is rendered as-is without activating inactive objects. Supports custom multi-light setups via JSON. Returns a base64-encoded PNG.
|
||||||
|
|
||||||
|
## Camera views
|
||||||
|
|
||||||
|
`Front` (-Z), `Back` (+Z), `Left` (-X), `Right` (+X), `Top` (+Y), `Bottom` (-Y). `Composite` produces a single 2x2 image (Front, Right, Back, Top) where each sub-view uses the requested `resolution`, so the final image is `resolution*2 x resolution*2`.
|
||||||
|
|
||||||
|
## Background modes
|
||||||
|
|
||||||
|
- `SolidColor` — flat color from `backgroundColor` (hex string).
|
||||||
|
- `Skybox` — current scene skybox.
|
||||||
|
- `Transparent` — alpha-zero (ARGB32 PNG; useful for compositing).
|
||||||
|
|
||||||
|
## Lights
|
||||||
|
|
||||||
|
`lights` is an optional JSON array of `IsolatedLightConfig` objects (type, color, intensity, rotation, position, range, spotAngle, innerSpotAngle, shadows, shadowStrength, bounceIntensity, colorTemperature, cookieSize, cullingMask, renderMode). When `null`, a default 1.0-intensity white directional light at rotation `(50, -30, 0)` is used. Empty array `[]` explicitly disables extra lights.
|
||||||
|
|
||||||
|
## Side-effect caveat
|
||||||
|
|
||||||
|
Isolation temporarily activates inactive child GameObjects so their renderers participate in the cull. Activation state is restored in `finally`, but OnEnable-triggered side effects (audio, networking, animation events) are not rewindable. Set `isolated=false` if your scene contains scripts that must not fire OnEnable during the capture.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool screenshot-isolated --input '{
|
||||||
|
"gameObjectRef": "string_value",
|
||||||
|
"includeChildren": "string_value",
|
||||||
|
"isolated": "string_value",
|
||||||
|
"backgroundMode": "string_value",
|
||||||
|
"backgroundColor": "string_value",
|
||||||
|
"cameraView": "string_value",
|
||||||
|
"fieldOfView": "string_value",
|
||||||
|
"nearClipPlane": "string_value",
|
||||||
|
"farClipPlane": "string_value",
|
||||||
|
"padding": "string_value",
|
||||||
|
"lights": "string_value",
|
||||||
|
"resolution": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool screenshot-isolated --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool screenshot-isolated --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `gameObjectRef` | `any` | Yes | Reference to the target GameObject (by instanceId, path, or name). |
|
||||||
|
| `includeChildren` | `any` | No | Include child GameObjects in the render. Default: true. |
|
||||||
|
| `isolated` | `any` | No | When true, renders only the target object using layer-based culling. When false, renders the full scene from the computed camera position. Default: true. |
|
||||||
|
| `backgroundMode` | `any` | No | Background mode. Default: SolidColor. |
|
||||||
|
| `backgroundColor` | `string` | No | Hex background color (e.g. '#404040'). Only used when backgroundMode is SolidColor. |
|
||||||
|
| `cameraView` | `any` | No | Camera angle relative to the target object's bounding box. Default: Front. |
|
||||||
|
| `fieldOfView` | `any` | No | Camera vertical field of view in degrees. Default: 60. |
|
||||||
|
| `nearClipPlane` | `any` | No | Camera near clip plane distance. Default: 0.01. |
|
||||||
|
| `farClipPlane` | `any` | No | Camera far clip plane distance. Default: 1000. |
|
||||||
|
| `padding` | `any` | No | Framing multiplier around the object. 1.0 = tight fit, 1.5 = 50% extra space. Default: 1.2. |
|
||||||
|
| `lights` | `string` | No | JSON array of light configurations. Each object defines type, color, intensity, rotation, position, range, spotAngle, shadows, etc. When null, a default white directional light at rotation (50,-30,0) is used. Example: [{"type":"Directional","color":"#FFF4E5","intensity":1.2,"rotation":[45,-45,0]}] |
|
||||||
|
| `resolution` | `any` | No | Output image resolution in pixels (width = height). Default: 512. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"gameObjectRef": {
|
||||||
|
"$ref": "#/$defs/AIGD.GameObjectRef"
|
||||||
|
},
|
||||||
|
"includeChildren": {
|
||||||
|
"$ref": "#/$defs/System.Boolean"
|
||||||
|
},
|
||||||
|
"isolated": {
|
||||||
|
"$ref": "#/$defs/System.Boolean"
|
||||||
|
},
|
||||||
|
"backgroundMode": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Screenshot-BackgroundMode"
|
||||||
|
},
|
||||||
|
"backgroundColor": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"cameraView": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Screenshot-CameraView"
|
||||||
|
},
|
||||||
|
"fieldOfView": {
|
||||||
|
"$ref": "#/$defs/System.Single"
|
||||||
|
},
|
||||||
|
"nearClipPlane": {
|
||||||
|
"$ref": "#/$defs/System.Single"
|
||||||
|
},
|
||||||
|
"farClipPlane": {
|
||||||
|
"$ref": "#/$defs/System.Single"
|
||||||
|
},
|
||||||
|
"padding": {
|
||||||
|
"$ref": "#/$defs/System.Single"
|
||||||
|
},
|
||||||
|
"lights": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"resolution": {
|
||||||
|
"$ref": "#/$defs/System.Int32"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Type": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"AIGD.GameObjectRef": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"instanceID": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "instanceID of the UnityEngine.Object. If it is '0' and 'path', 'name', 'assetPath' and 'assetGuid' is not provided, empty or null, then it will be used as 'null'. Priority: 1 (Recommended)"
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path of a GameObject in the hierarchy Sample 'character/hand/finger/particle'. Priority: 2."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of a GameObject in hierarchy. Priority: 3."
|
||||||
|
},
|
||||||
|
"assetType": {
|
||||||
|
"$ref": "#/$defs/System.Type",
|
||||||
|
"description": "Type of the asset."
|
||||||
|
},
|
||||||
|
"assetPath": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Path to the asset within the project. Starts with 'Assets/'"
|
||||||
|
},
|
||||||
|
"assetGuid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unique identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"instanceID"
|
||||||
|
],
|
||||||
|
"description": "Find GameObject in opened Prefab or in the active Scene."
|
||||||
|
},
|
||||||
|
"System.Boolean": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.Unity.MCP.Editor.API.Tool_Screenshot-BackgroundMode": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"SolidColor",
|
||||||
|
"Skybox",
|
||||||
|
"Transparent"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.Unity.MCP.Editor.API.Tool_Screenshot-CameraView": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"Front",
|
||||||
|
"Back",
|
||||||
|
"Left",
|
||||||
|
"Right",
|
||||||
|
"Top",
|
||||||
|
"Bottom",
|
||||||
|
"Composite"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"System.Single": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"System.Int32": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"gameObjectRef"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
This tool does not return structured output.
|
||||||
|
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
---
|
||||||
|
name: screenshot-scene-view
|
||||||
|
description: Capture a screenshot from the Unity Editor Scene View at the requested size. Renders via the Scene View's active camera onto a temporary `RenderTexture`. Requires an open Scene View.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Screenshot / Scene View
|
||||||
|
|
||||||
|
Captures a screenshot from the Unity Editor Scene View and returns it as an image. Returns the image directly for visual inspection by the LLM.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `width` (default 1920) / `height` (default 1080) — output pixels. Must be > 0 and ≤ `MaxDimension`.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Uses `SceneView.lastActiveSceneView` (falls back to the first window in `SceneView.sceneViews`). Allocates a temporary `RenderTexture`, swaps it onto the Scene View's camera, calls `Render`, reads back with `Texture2D.ReadPixels`, encodes PNG, and restores the camera's prior `targetTexture`. Throws/errors when no Scene View is open or the Scene View camera is null.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool screenshot-scene-view --input '{
|
||||||
|
"width": 0,
|
||||||
|
"height": 0
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool screenshot-scene-view --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool screenshot-scene-view --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `width` | `integer` | No | Width of the screenshot in pixels. |
|
||||||
|
| `height` | `integer` | No | Height of the screenshot in pixels. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"width": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"height": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
This tool does not return structured output.
|
||||||
|
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
---
|
||||||
|
name: script-delete
|
||||||
|
description: Delete one or more `.cs` script files from disk, refresh the AssetDatabase, and wait for Unity compilation to settle before delivering the final result via the request's `requestId`. Pair with 'script-read' to inspect files before deletion.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Script / Delete
|
||||||
|
|
||||||
|
Delete the script file(s). Does AssetDatabase.Refresh() and waits for Unity compilation to complete before reporting results. Use 'script-read' tool to read existing script files first.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `files` — non-empty array of `.cs` paths. Every entry must exist on disk.
|
||||||
|
- `requestId` — required for the processing/delivered-later contract.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Validates the array (non-empty, every entry ends with `.cs`, every entry exists). Deletes each file plus its sibling `.meta` (when present). Calls `AssetDatabase.Refresh` and schedules a post-compilation notification — the final response is delivered after Unity finishes the recompile triggered by the delete.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool script-delete --input '{
|
||||||
|
"files": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool script-delete --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool script-delete --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `files` | `any` | Yes | File paths to the files. Sample: "Assets/Scripts/MyScript.cs". |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"files": {
|
||||||
|
"$ref": "#/$defs/System.String-1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.String-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"files"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
This tool does not return structured output.
|
||||||
|
|
||||||
@@ -0,0 +1,196 @@
|
|||||||
|
---
|
||||||
|
name: script-execute
|
||||||
|
description: Compiles and executes C# code dynamically using Roslyn. Supports a full-code mode (default) and a body-only mode — see the skill body for the difference and for how to pass Unity object references as parameters.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Script / Execute
|
||||||
|
|
||||||
|
## Modes
|
||||||
|
|
||||||
|
- **Full code mode** (default, `isMethodBody=false`): the `csharpCode` argument must define a complete class with a static method (no top-level statements).
|
||||||
|
- **Body-only mode** (`isMethodBody=true`): provide only the method body statements. The tool auto-generates the usings, class, and method header.
|
||||||
|
|
||||||
|
## Passing Unity objects as parameters
|
||||||
|
|
||||||
|
Unity objects (`GameObject`, `Component`, etc.) can be passed as parameters using their `Ref` types (`GameObjectRef`, `ComponentRef`, etc.) or directly by type:
|
||||||
|
|
||||||
|
- `UnityEngine.GameObject` — resolves an actual GameObject from value `{"instanceID": N}`, `{"name": "..."}`, or `{"path": "..."}`.
|
||||||
|
- `UnityEngine.Component` (or any component subtype) — resolves from `{"instanceID": N}`.
|
||||||
|
- `AIGD.GameObjectRef` — passes a `GameObjectRef` POCO directly; the method body calls `goRef.FindGameObject()` to resolve it.
|
||||||
|
- `AIGD.ComponentRef` — passes a `ComponentRef` POCO.
|
||||||
|
- `AIGD.ObjectRef` — passes a base `ObjectRef` POCO.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool script-execute --input '{
|
||||||
|
"csharpCode": "string_value",
|
||||||
|
"className": "string_value",
|
||||||
|
"methodName": "string_value",
|
||||||
|
"parameters": "string_value",
|
||||||
|
"isMethodBody": false
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool script-execute --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool script-execute --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `csharpCode` | `string` | Yes | C# code to compile and execute. In full code mode (default, isMethodBody=false): must define a complete class with a static method. Example: 'using UnityEngine; public class Script { public static void Main() { Debug.Log("Hello"); } }'. Do NOT use top-level statements. In body-only mode (isMethodBody=true): provide only the method body statements. The tool auto-generates usings, class, and method header. Example body: 'go.SetActive(false);'. Custom helper classes can still be defined inline in the body-only string after the main logic, but for complex additional class definitions use full code mode instead. |
|
||||||
|
| `className` | `string` | No | The name of the class containing the method to execute. In body-only mode this becomes the generated class name. |
|
||||||
|
| `methodName` | `string` | No | The name of the method to execute. Must be a static method. In body-only mode this becomes the generated method name. |
|
||||||
|
| `parameters` | `any` | No | Serialized parameters to pass to the method. Each entry must specify 'name' and 'typeName'. Supported parameter types include primitives, strings, and Unity object references: - 'UnityEngine.GameObject': resolves an actual GameObject from value '{"instanceID": N}', '{"name": "..."}', or '{"path": "..."}'. - 'UnityEngine.Component' (or any component subtype): resolves from '{"instanceID": N}'. - 'AIGD.GameObjectRef': passes a GameObjectRef POCO directly; the method body calls goRef.FindGameObject() to resolve it. - 'AIGD.ComponentRef': passes a ComponentRef POCO. - 'AIGD.ObjectRef': passes a base ObjectRef POCO. If the method does not require parameters, leave this empty. |
|
||||||
|
| `isMethodBody` | `boolean` | No | When true, 'csharpCode' is treated as just the method body. The tool auto-generates standard using directives (System, UnityEngine, AIGD, com.IvanMurzak.Unity.MCP.Runtime.Extensions, UnityEditor), the class definition, and the method signature (void return type). Parameters from the 'parameters' list are automatically added to the method signature using their typeName and name. When false (default), 'csharpCode' must be a complete C# compilation unit with class and method definitions. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"csharpCode": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"className": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"methodName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"parameters": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMemberList"
|
||||||
|
},
|
||||||
|
"isMethodBody": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMember": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Object name."
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json."
|
||||||
|
},
|
||||||
|
"fields": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested field value."
|
||||||
|
},
|
||||||
|
"description": "Fields of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
},
|
||||||
|
"props": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested property value."
|
||||||
|
},
|
||||||
|
"description": "Properties of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"typeName"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"csharpCode"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMemberList": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.SerializedMember": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"typeName": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Full type name. Eg: 'System.String', 'System.Int32', 'UnityEngine.Vector3', etc."
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Object name."
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"description": "Value of the object, serialized as a non stringified JSON element. Can be null if the value is not set. Can be default value if the value is an empty object or array json."
|
||||||
|
},
|
||||||
|
"fields": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested field value."
|
||||||
|
},
|
||||||
|
"description": "Fields of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
},
|
||||||
|
"props": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.SerializedMember",
|
||||||
|
"description": "Nested property value."
|
||||||
|
},
|
||||||
|
"description": "Properties of the object, serialized as a list of 'SerializedMember'."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"typeName"
|
||||||
|
],
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
---
|
||||||
|
name: script-read
|
||||||
|
description: Read a `.cs` script file and return its content as a string. Supports a 1-based `lineFrom`/`lineTo` slice for partial reads. Pair with 'script-update-or-create' to write back.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Script / Read
|
||||||
|
|
||||||
|
Reads the content of a script file and returns it as a string. Use 'script-update-or-create' tool to update or create script files.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `filePath` — required `.cs` path. Throws if missing on disk.
|
||||||
|
- `lineFrom` (default 1, 1-based) — start line; clamped into valid range.
|
||||||
|
- `lineTo` (default -1 = end-of-file, 1-based) — inclusive end line; clamped into valid range.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Reads the file with `File.ReadAllLines` and slices `[lineFrom..lineTo]` (inclusive). The slice indices are clamped — passing out-of-range `lineFrom`/`lineTo` is forgiving (read returns at-most the whole file).
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool script-read --input '{
|
||||||
|
"filePath": "string_value",
|
||||||
|
"lineFrom": 0,
|
||||||
|
"lineTo": 0
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool script-read --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool script-read --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `filePath` | `string` | Yes | The path to the file. Sample: "Assets/Scripts/MyScript.cs". |
|
||||||
|
| `lineFrom` | `integer` | No | The line number to start reading from (1-based). |
|
||||||
|
| `lineTo` | `integer` | No | The line number to stop reading at (1-based, -1 for all lines). |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"filePath": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"lineFrom": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"lineTo": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"filePath"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
---
|
||||||
|
name: script-update-or-create
|
||||||
|
description: Write a `.cs` script file (create or overwrite) with the provided C# code. Validates syntax via Roslyn before write — invalid code is rejected with error details and the file is left untouched. Refreshes the AssetDatabase and delivers the final result via `requestId` after Unity finishes the triggered compilation. Use 'script-read' to inspect existing content first.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Script / Update or Create
|
||||||
|
|
||||||
|
Updates or creates script file with the provided C# code. Does AssetDatabase.Refresh() at the end. Provides compilation error details if the code has syntax errors. Use 'script-read' tool to read existing script files first.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `filePath` — required `.cs` path.
|
||||||
|
- `content` — C# source. MUST pass `ScriptUtils.IsValidCSharpSyntax`.
|
||||||
|
- `requestId` — required for the processing/delivered-later contract.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Creates any missing parent directories, writes the file, then calls `AssetDatabase.Refresh` and schedules a post-compilation notification so the final response is delivered after Unity finishes the recompile.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool script-update-or-create --input '{
|
||||||
|
"filePath": "string_value",
|
||||||
|
"content": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool script-update-or-create --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool script-update-or-create --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `filePath` | `string` | Yes | The path to the file. Sample: "Assets/Scripts/MyScript.cs". |
|
||||||
|
| `content` | `string` | Yes | C# code - content of the file. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"filePath": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"content": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"filePath",
|
||||||
|
"content"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
This tool does not return structured output.
|
||||||
|
|
||||||
@@ -0,0 +1,279 @@
|
|||||||
|
---
|
||||||
|
name: tests-run
|
||||||
|
description: "Execute Unity tests (`EditMode` or `PlayMode`) and return per-test results. Supports filtering by test assembly, namespace, class, and method. Refreshes the AssetDatabase first; defers execution across domain reloads if scripts changed. Precondition: every open scene must be saved — dirty scenes abort the run."
|
||||||
|
---
|
||||||
|
|
||||||
|
# Tests / Run
|
||||||
|
|
||||||
|
Execute Unity tests and return detailed results. Supports filtering by test mode, assembly, namespace, class, and method. Recommended to use 'EditMode' for faster iteration during development. Precondition: every open scene MUST be saved (no unsaved changes). If any open scene is dirty, this tool throws an InvalidOperationException listing the dirty scenes; save them and retry.
|
||||||
|
|
||||||
|
## Filters
|
||||||
|
|
||||||
|
- `testMode` (default `EditMode`) — `EditMode` or `PlayMode`. EditMode is faster; prefer it during iteration.
|
||||||
|
- `testAssembly` / `testNamespace` / `testClass` / `testMethod` — optional, layered filters. Namespace and class filters become regex `groupNames` so the validation count and Unity's execution stay in sync. `testMethod` must be fully qualified (`Namespace.FixtureName.TestName`).
|
||||||
|
|
||||||
|
## Response toggles
|
||||||
|
|
||||||
|
- `includePassingTests` (default `false`) — include details for passing tests; otherwise only failing test details are returned.
|
||||||
|
- `includeMessages` (default `true`) — include per-test result messages.
|
||||||
|
- `includeStacktrace` (default `false`) — include stack traces for failing tests.
|
||||||
|
- `includeLogs` (default `false`) — include console logs captured during the run.
|
||||||
|
- `logType` (default `Warning`) — minimum log severity to include.
|
||||||
|
- `includeLogsStacktrace` (default `false`) — include log stack traces (large payload; use sparingly).
|
||||||
|
|
||||||
|
## Domain reloads
|
||||||
|
|
||||||
|
If the AssetDatabase refresh triggers compilation, the tool persists the run parameters to `SessionState`, returns `Processing`, and resumes the run automatically after the reload completes. Pre-existing compilation errors short-circuit the run and return the error details so the caller can fix the project first.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool tests-run --input '{
|
||||||
|
"testMode": "string_value",
|
||||||
|
"testAssembly": "string_value",
|
||||||
|
"testNamespace": "string_value",
|
||||||
|
"testClass": "string_value",
|
||||||
|
"testMethod": "string_value",
|
||||||
|
"includePassingTests": false,
|
||||||
|
"includeMessages": false,
|
||||||
|
"includeStacktrace": false,
|
||||||
|
"includeLogs": false,
|
||||||
|
"logType": "string_value",
|
||||||
|
"includeLogsStacktrace": false
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool tests-run --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool tests-run --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `testMode` | `string` | No | Test mode to run. Options: 'EditMode', 'PlayMode'. Default: 'EditMode' |
|
||||||
|
| `testAssembly` | `string` | No | Specific test assembly name to run (optional). Example: 'Assembly-CSharp-Editor-testable' |
|
||||||
|
| `testNamespace` | `string` | No | Specific test namespace to run (optional). Example: 'MyTestNamespace' |
|
||||||
|
| `testClass` | `string` | No | Specific test class name to run (optional). Example: 'MyTestClass' |
|
||||||
|
| `testMethod` | `string` | No | Specific fully qualified test method to run (optional). Example: 'MyTestNamespace.FixtureName.TestName' |
|
||||||
|
| `includePassingTests` | `boolean` | No | Include details for all tests, both passing and failing (default: false). If you just need details for failing tests, set to false. |
|
||||||
|
| `includeMessages` | `boolean` | No | Include test result messages in the test results (default: true). If you just need pass/fail status, set to false. |
|
||||||
|
| `includeStacktrace` | `boolean` | No | Include stack traces in the test results (default: false). |
|
||||||
|
| `includeLogs` | `boolean` | No | Include console logs in the test results (default: false). |
|
||||||
|
| `logType` | `string` | No | Log type filter for console logs. Options: 'Log', 'Warning', 'Assert', 'Error', 'Exception'. (default: 'Warning') |
|
||||||
|
| `includeLogsStacktrace` | `boolean` | No | Include stack traces for console logs in the test results (default: false). This is huge amount of data, use only if really needed. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"testMode": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"EditMode",
|
||||||
|
"PlayMode"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"testAssembly": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"testNamespace": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"testClass": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"testMethod": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"includePassingTests": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"includeMessages": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"includeStacktrace": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"includeLogs": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"logType": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"Error",
|
||||||
|
"Assert",
|
||||||
|
"Warning",
|
||||||
|
"Log",
|
||||||
|
"Exception"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"includeLogsStacktrace": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestRunResponse"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestSummaryData": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Status": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"Unknown",
|
||||||
|
"Passed",
|
||||||
|
"Failed"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"TotalTests": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"PassedTests": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"FailedTests": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"SkippedTests": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"Duration": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"Status",
|
||||||
|
"TotalTests",
|
||||||
|
"PassedTests",
|
||||||
|
"FailedTests",
|
||||||
|
"SkippedTests",
|
||||||
|
"Duration"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestResultData)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestResultData"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestResultData": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"Status": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"Passed",
|
||||||
|
"Failed",
|
||||||
|
"Skipped"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Duration": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"Message": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"StackTrace": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"Status",
|
||||||
|
"Duration"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestLogEntry)": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestLogEntry"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestLogEntry": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Condition": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"StackTrace": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"Type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"Error",
|
||||||
|
"Assert",
|
||||||
|
"Warning",
|
||||||
|
"Log",
|
||||||
|
"Exception"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"Timestamp": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "date-time"
|
||||||
|
},
|
||||||
|
"LogLevel": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"Type",
|
||||||
|
"Timestamp"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestRunResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Summary": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestSummaryData",
|
||||||
|
"description": "Summary of the test run including total, passed, failed, and skipped counts."
|
||||||
|
},
|
||||||
|
"Results": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestResultData)",
|
||||||
|
"description": "List of individual test results with details about each test."
|
||||||
|
},
|
||||||
|
"Logs": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestLogEntry)",
|
||||||
|
"description": "Log entries captured during test execution."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,170 @@
|
|||||||
|
---
|
||||||
|
name: tool-set-enabled-state
|
||||||
|
description: Enable or disable MCP tools by name in batch. Persists the change via `UnityMcpPluginEditor.Instance.Save()` only when at least one tool actually flipped. Returns per-input success flags plus optional operation logs.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Tool / Set Enabled State
|
||||||
|
|
||||||
|
Enable or disable MCP tools by name. Allows controlling which tools are available for the AI agent.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `tools` — array of `ToolToggleInput { Name, Enabled }`. Non-empty.
|
||||||
|
- `includeLogs` (default `false`) — when true, returns per-step operation logs alongside the success map.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Each entry is resolved against the tool manager's exact-name and case-insensitive lookups. Already-correct state short-circuits as success without writing. The plugin's config is saved once at the end iff at least one tool actually changed state.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool tool-set-enabled-state --input '{
|
||||||
|
"tools": "string_value",
|
||||||
|
"includeLogs": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool tool-set-enabled-state --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool tool-set-enabled-state --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `tools` | `any` | Yes | Array of tools with their desired enabled state. |
|
||||||
|
| `includeLogs` | `any` | No | Include operation logs in the result. Default: false |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"tools": {
|
||||||
|
"$ref": "#/$defs/AIGD.ToolToggleInput-1"
|
||||||
|
},
|
||||||
|
"includeLogs": {
|
||||||
|
"$ref": "#/$defs/System.Boolean"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.ToolToggleInput": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Name of the MCP tool to enable or disable."
|
||||||
|
},
|
||||||
|
"Enabled": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Whether the tool should be enabled (true) or disabled (false)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"Enabled"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"AIGD.ToolToggleInput-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.ToolToggleInput"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"System.Boolean": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"tools"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.ToolToggleResult"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.Logs": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.LogEntry"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.ReflectorNet.Model.LogEntry": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Depth": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"Message": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"Type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"Trace",
|
||||||
|
"Debug",
|
||||||
|
"Info",
|
||||||
|
"Success",
|
||||||
|
"Warning",
|
||||||
|
"Error",
|
||||||
|
"Critical"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"Depth",
|
||||||
|
"Type"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"System.Collections.Generic.Dictionary(System.String,System.Boolean)": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.ToolToggleResult": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"Logs": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.ReflectorNet.Model.Logs",
|
||||||
|
"description": "Optional operation logs. Only included when 'includeLogs' is true."
|
||||||
|
},
|
||||||
|
"Success": {
|
||||||
|
"$ref": "#/$defs/System.Collections.Generic.Dictionary(System.String,System.Boolean)",
|
||||||
|
"description": "Result of each tool operation. Key: original input name as provided by the caller (case preserved as-is). Value: true if the enable/disable operation completed successfully, false if the name was unknown, ambiguous, or empty."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
---
|
||||||
|
name: type-get-json-schema
|
||||||
|
description: Generate a JSON Schema for a C# type name via reflection. Supports primitives, enums, arrays, generic collections, dictionaries, and complex objects. Knobs control inclusion of nested `$defs` and whether type-level / property-level descriptions are emitted.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Type / Get Json Schema
|
||||||
|
|
||||||
|
Generates a JSON Schema for a given C# type name using reflection. Supports primitives, enums, arrays, generic collections, dictionaries, and complex objects. The type must be present in any loaded assembly. Use the full type name (e.g. 'UnityEngine.Vector3') for best results.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `typeName` — full type name preferred (e.g. `UnityEngine.Vector3`, `System.Collections.Generic.List<System.Int32>`). Simple names work when unambiguous.
|
||||||
|
- `descriptionMode` (default `Ignore`) — controls type-level `description`: `Include` keeps it on the target only, `IncludeRecursively` also keeps it inside `$defs`, `Ignore` strips all.
|
||||||
|
- `propertyDescriptionMode` (default `Ignore`) — controls property/field/item `description`: `Include` keeps on the target's own properties/items only, `IncludeRecursively` also keeps inside `$defs`, `Ignore` strips all.
|
||||||
|
- `includeNestedTypes` (default `false`) — when true, complex nested types are extracted into `$defs` and referenced via `$ref`. Useful for recursive or large types.
|
||||||
|
- `writeIndented` (default `false`) — pretty-print the output JSON.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool type-get-json-schema --input '{
|
||||||
|
"typeName": "string_value",
|
||||||
|
"descriptionMode": "string_value",
|
||||||
|
"propertyDescriptionMode": "string_value",
|
||||||
|
"includeNestedTypes": false,
|
||||||
|
"writeIndented": false
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool type-get-json-schema --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool type-get-json-schema --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `typeName` | `string` | Yes | Full C# type name to generate the schema for. Examples: 'System.String', 'UnityEngine.Vector3', 'System.Collections.Generic.List<System.Int32>'. Simple names like 'Vector3' are also accepted when unambiguous. |
|
||||||
|
| `descriptionMode` | `string` | No | Controls the type-level 'description' field. Include: keep on the target type only. IncludeRecursively: keep on the target type and inside $defs entries. Ignore: strip all type-level descriptions. Default: Ignore. |
|
||||||
|
| `propertyDescriptionMode` | `string` | No | Controls 'description' fields on properties, fields, and array items. Include: keep on the target type's own properties/items only. IncludeRecursively: keep on all properties/items including those inside $defs entries. Ignore: strip all property/item descriptions. Default: Ignore. |
|
||||||
|
| `includeNestedTypes` | `boolean` | No | When true, complex nested types are extracted into '$defs' and referenced via '$ref' instead of being inlined. Useful for large or recursive types. Default: false. |
|
||||||
|
| `writeIndented` | `boolean` | No | Whether to format the output JSON with indentation for readability. Default: false. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"typeName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"descriptionMode": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"Include",
|
||||||
|
"IncludeRecursively",
|
||||||
|
"Ignore"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"propertyDescriptionMode": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"Include",
|
||||||
|
"IncludeRecursively",
|
||||||
|
"Ignore"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"includeNestedTypes": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"writeIndented": {
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"typeName"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
---
|
||||||
|
name: unity-initial-setup
|
||||||
|
description: |-
|
||||||
|
Provides an initial setup for AI Skills, `unity-mcp-cli` command line tool installation
|
||||||
|
and everything else that is helpful to set up at the start of the project. Essential packages,
|
||||||
|
and basic configurations.
|
||||||
|
---
|
||||||
|
|
||||||
|
# AI Game Developer — Initial Setup
|
||||||
|
|
||||||
|
This guide walks through installing the `unity-mcp-cli` command-line tool and using it to set
|
||||||
|
up a Unity project with AI Skills and MCP integration.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
### Install Node.js
|
||||||
|
|
||||||
|
`unity-mcp-cli` requires **Node.js ^20.19.0 || >=22.12.0** (Node 21.x is not supported). If you don't have Node.js installed:
|
||||||
|
|
||||||
|
Download the installer from https://nodejs.org/ and run it, or use a package manager:
|
||||||
|
```
|
||||||
|
winget install OpenJS.NodeJS.LTS
|
||||||
|
```
|
||||||
|
|
||||||
|
After installation, verify both `node` and `npm` are available:
|
||||||
|
```
|
||||||
|
node --version
|
||||||
|
npm --version
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Install `unity-mcp-cli` Globally
|
||||||
|
|
||||||
|
Install the CLI globally so the `unity-mcp-cli` command is available system-wide:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install -g unity-mcp-cli
|
||||||
|
```
|
||||||
|
|
||||||
|
Verify installation:
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli --version
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
> **Alternative**: Run any command without installing globally using `npx`:
|
||||||
|
> ```bash
|
||||||
|
> npx unity-mcp-cli --help
|
||||||
|
> ```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Quick Start — Full Project Setup
|
||||||
|
|
||||||
|
### 1. Install the Unity-MCP Plugin
|
||||||
|
|
||||||
|
Add the plugin to an existing Unity project:
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli install-plugin /path/to/unity/project
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. Configure MCP Tools
|
||||||
|
|
||||||
|
Enable all tools, prompts, and resources:
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli configure /path/to/unity/project \
|
||||||
|
--enable-all-tools \
|
||||||
|
--enable-all-prompts \
|
||||||
|
--enable-all-resources
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. Set Up MCP for Your AI Agent
|
||||||
|
|
||||||
|
Configure MCP integration for your AI agent (e.g., Claude Code, Cursor, Copilot):
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli setup-mcp claude-code /path/to/unity/project
|
||||||
|
```
|
||||||
|
|
||||||
|
List all supported agents:
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli setup-mcp --list
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4. Generate AI Skills
|
||||||
|
|
||||||
|
Generate skill files for your AI agent (requires Unity Editor to be running with the plugin):
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli setup-skills claude-code /path/to/unity/project
|
||||||
|
```
|
||||||
|
|
||||||
|
### 5. Open Unity with MCP Connection
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli open /path/to/unity/project
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Common Commands Reference
|
||||||
|
|
||||||
|
| Command | Description |
|
||||||
|
|---|---|
|
||||||
|
| `unity-mcp-cli install-plugin <path>` | Install Unity-MCP plugin into a project |
|
||||||
|
| `unity-mcp-cli remove-plugin <path>` | Remove Unity-MCP plugin from a project |
|
||||||
|
| `unity-mcp-cli configure <path> --list` | List current MCP configuration |
|
||||||
|
| `unity-mcp-cli setup-mcp <agent> <path>` | Write MCP config for an AI agent |
|
||||||
|
| `unity-mcp-cli setup-skills <agent> <path>` | Generate skill files for an AI agent |
|
||||||
|
| `unity-mcp-cli create-project <path>` | Create a new Unity project |
|
||||||
|
| `unity-mcp-cli install-unity <version>` | Install a Unity Editor version |
|
||||||
|
| `unity-mcp-cli open <path>` | Open a Unity project in the Editor |
|
||||||
|
| `unity-mcp-cli run-tool <tool> <path>` | Execute an MCP tool via HTTP API |
|
||||||
|
|
||||||
|
Add `--verbose` to any command for detailed diagnostic output.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
- **`npm` not found**: Node.js is not installed or not in your PATH. Reinstall Node.js and restart your terminal.
|
||||||
|
- **Plugin not appearing in Unity**: After `install-plugin`, open the project in Unity Editor. The package manager resolves dependencies on project open.
|
||||||
|
- **Skills generation fails**: Ensure Unity Editor is running with the MCP plugin installed and connected before running `setup-skills`.
|
||||||
@@ -0,0 +1,206 @@
|
|||||||
|
---
|
||||||
|
name: unity-skill-create
|
||||||
|
description: Create a new skill (MCP tool) for the Unity Editor by writing a C# (.cs) file that Unity compiles into the project. After compilation the new tool becomes callable through MCP. The file must be a partial class decorated with [AiToolType], each tool method must be decorated with [AiTool], the class name should match the file name, all Unity API calls must run via com.IvanMurzak.ReflectorNet.Utils.MainThread.Instance.Run(), and the method should either return a structured data model (for parseable output) or void (for side-effect-only operations). See the body of this skill for a full sample and best-practice notes.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Skill (Tool) / Create
|
||||||
|
|
||||||
|
## Full sample
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
#nullable enable
|
||||||
|
using System;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using com.IvanMurzak.McpPlugin;
|
||||||
|
using com.IvanMurzak.ReflectorNet.Utils;
|
||||||
|
using com.IvanMurzak.Unity.MCP.Editor.Utils;
|
||||||
|
using AIGD;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace com.IvanMurzak.Unity.MCP.Editor.API
|
||||||
|
{
|
||||||
|
[AiToolType]
|
||||||
|
public partial class Tool_Sample
|
||||||
|
{
|
||||||
|
[AiTool("sample-get", Title = "Sample / Get")]
|
||||||
|
[Description("Finds a GameObject and returns its ref data.")]
|
||||||
|
public GameObjectRef Get
|
||||||
|
(
|
||||||
|
[Description("Name of the GameObject to find.")]
|
||||||
|
string name
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return MainThread.Instance.Run(() =>
|
||||||
|
{
|
||||||
|
var go = GameObject.Find(name)
|
||||||
|
?? throw new ArgumentException($"GameObject '{name}' not found.", nameof(name));
|
||||||
|
|
||||||
|
return new GameObjectRef(go);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
[AiTool("sample-rename", Title = "Sample / Rename")]
|
||||||
|
[Description("Renames a GameObject.")]
|
||||||
|
public void Rename
|
||||||
|
(
|
||||||
|
[Description("Current name of the GameObject.")]
|
||||||
|
string name,
|
||||||
|
[Description("New name to assign.")]
|
||||||
|
string newName
|
||||||
|
)
|
||||||
|
{
|
||||||
|
MainThread.Instance.Run(() =>
|
||||||
|
{
|
||||||
|
var go = GameObject.Find(name)
|
||||||
|
?? throw new ArgumentException($"GameObject '{name}' not found.", nameof(name));
|
||||||
|
|
||||||
|
go.name = newName;
|
||||||
|
EditorUtility.SetDirty(go);
|
||||||
|
AssetDatabase.Refresh(ImportAssetOptions.ForceSynchronousImport);
|
||||||
|
EditorUtils.RepaintAllEditorWindows();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Suggestions
|
||||||
|
|
||||||
|
### Refresh UI after visual changes
|
||||||
|
If the skill modifies anything visually in the Unity Editor (GameObjects, components, materials, etc.), call these two lines at the end of the tool method to apply changes to the UI immediately:
|
||||||
|
```csharp
|
||||||
|
AssetDatabase.Refresh(ImportAssetOptions.ForceSynchronousImport);
|
||||||
|
EditorUtils.RepaintAllEditorWindows();
|
||||||
|
```
|
||||||
|
|
||||||
|
### Refresh AssetDatabase after asset or script changes
|
||||||
|
If the skill creates, modifies, or deletes any asset file or .cs script on disk outside of Unity API, call this inside a `MainThread.Instance.Run()` block to ensure Unity picks up the changes:
|
||||||
|
```csharp
|
||||||
|
MainThread.Instance.Run(() =>
|
||||||
|
{
|
||||||
|
AssetDatabase.Refresh(ImportAssetOptions.ForceSynchronousImport);
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### Use processing mechanic for long-running or domain-reload operations
|
||||||
|
Some operations take time to complete and may trigger a Unity domain reload (e.g. writing a .cs script, switching play mode, running tests, adding a package). In these cases the tool must NOT block and wait — instead it must:
|
||||||
|
1. Accept a `[RequestID] string? requestId` parameter.
|
||||||
|
2. Return `ResponseCallTool.Processing("...").SetRequestID(requestId)` immediately.
|
||||||
|
3. Schedule the actual work asynchronously via `MainThread.Instance.RunAsync(async () => { await Task.Yield(); ... })`.
|
||||||
|
4. When the operation finishes, send the final result by calling:
|
||||||
|
```csharp
|
||||||
|
_ = UnityMcpPluginEditor.NotifyToolRequestCompleted(new RequestToolCompletedData
|
||||||
|
{
|
||||||
|
RequestId = requestId,
|
||||||
|
Result = ResponseCallTool.Success("Operation completed.").SetRequestID(requestId)
|
||||||
|
});
|
||||||
|
```
|
||||||
|
If the operation may survive a domain reload (e.g. a .cs file was saved and Unity will recompile), use `ScriptUtils.SchedulePostCompilationNotification(requestId, filePath, operationType)` instead of calling `NotifyToolRequestCompleted` directly — it persists the pending notification to `SessionState` and sends it automatically after the domain reload completes. For package install/removal or other non-compilation domain reloads use `PackageUtils.SchedulePostDomainReloadNotification(requestId, label, action, expectedResult)` the same way.
|
||||||
|
|
||||||
|
### Return structured data with a typed response
|
||||||
|
Prefer returning a structured data model over a plain string so the AI can parse individual fields. Data models for MCP tools MUST be declared as TOP-LEVEL types in the `AIGD` namespace - never nested inside the tool class. Place each data model in its own `.cs` file (one type per file) and use `ResponseCallValueTool<T>` as the return type. The flat `AIGD` namespace keeps the auto-generated JSON Schema `$defs` keys short and intuitive for AI agents.
|
||||||
|
```csharp
|
||||||
|
// Tool file (Tool/MyTool.cs) - references the data model from AIGD:
|
||||||
|
using AIGD;
|
||||||
|
|
||||||
|
namespace com.IvanMurzak.Unity.MCP.Editor.API
|
||||||
|
{
|
||||||
|
[AiToolType]
|
||||||
|
public partial class Tool_Sample
|
||||||
|
{
|
||||||
|
public ResponseCallValueTool<MyResult> MyTool(...)
|
||||||
|
{
|
||||||
|
return ResponseCallValueTool<MyResult>.Success(new MyResult
|
||||||
|
{
|
||||||
|
Name = go.name,
|
||||||
|
InstanceID = go.GetInstanceID()
|
||||||
|
}).SetRequestID(requestId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Data model (Tool/Data/MyResult.cs) - top-level, in AIGD namespace, NOT nested:
|
||||||
|
namespace AIGD
|
||||||
|
{
|
||||||
|
public class MyResult
|
||||||
|
{
|
||||||
|
[Description("Name of the GameObject.")]
|
||||||
|
public string? Name { get; set; }
|
||||||
|
|
||||||
|
[Description("Unity instance ID of the GameObject.")]
|
||||||
|
public int InstanceID { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
For simpler cases that do not need async/processing, you may return the model directly (without `ResponseCallValueTool<T>`) and Unity-MCP will wrap it automatically. The data model itself MUST still live as a top-level type in the `AIGD` namespace.
|
||||||
|
|
||||||
|
### Validate inputs early and throw clearly
|
||||||
|
Always validate required parameters at the top of the method before any Unity API calls. Throw `ArgumentException` or `InvalidOperationException` with descriptive messages so the AI knows exactly what went wrong and can self-correct:
|
||||||
|
```csharp
|
||||||
|
if (string.IsNullOrEmpty(name))
|
||||||
|
throw new ArgumentException("Name cannot be null or empty.", nameof(name));
|
||||||
|
```
|
||||||
|
|
||||||
|
### Always use MainThread for Unity API calls
|
||||||
|
All Unity API calls (including `GameObject.Find`, `AssetDatabase`, `EditorUtility`, etc.) MUST run on the main thread. Wrap them in `MainThread.Instance.Run(() => { ... })` for synchronous operations, or `MainThread.Instance.RunAsync(async () => { ... })` when you need to await inside.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-system-tool unity-skill-create --input '{
|
||||||
|
"path": "string_value",
|
||||||
|
"code": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-system-tool unity-skill-create --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-system-tool unity-skill-create --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `path` | `string` | Yes | Path for the C# (.cs) file to be created. Sample: "Assets/Skills/MySkill.cs".
|
||||||
|
CRITICAL — Assembly Definition placement: If the project uses Assembly Definition files (.asmdef), you MUST place the script inside a folder that belongs to an assembly definition which already references all required dependencies (e.g. com.IvanMurzak.McpPlugin, UnityEditor, UnityEngine). Placing the file in the wrong assembly will cause compile errors due to missing type references. Before choosing a path, inspect existing .asmdef files with the assets-find tool to identify the correct assembly folder. |
|
||||||
|
| `code` | `string` | Yes | C# code for the skill tool. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"path": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"code": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"path",
|
||||||
|
"code"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
This tool does not return structured output.
|
||||||
|
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
---
|
||||||
|
name: unity-skill-generate
|
||||||
|
description: "Regenerate every `SKILL.md` from the project's currently-registered MCP tools into the configured skills folder (or a project-relative override path). Writes the YAML `description:` from `[AiSkillDescription]` and the body from `[AiSkillBody]`."
|
||||||
|
---
|
||||||
|
|
||||||
|
# Skill (Tool) / Generate All
|
||||||
|
|
||||||
|
Generate all skills from the existed Tools in the Unity Project.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `path` (optional) — project-relative skills folder (e.g. `.claude/skills`). Absolute paths and `..` traversal segments are rejected. When null/empty, the editor's configured `SkillsRootFolderAbsolutePath` is used.
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Creates the destination folder if missing, then invokes `McpPluginInstance.GenerateSkillFiles(...)` to emit a `SKILL.md` per registered MCP tool. The plugin's `SkillsPath` is temporarily swapped to the target folder and restored in `finally` so the on-disk configuration is unchanged after the call returns.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-system-tool unity-skill-generate --input '{
|
||||||
|
"path": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-system-tool unity-skill-generate --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-system-tool unity-skill-generate --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `path` | `string` | No | Path to the skills folder. If null or empty, the default path will be used. |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"path": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
This tool does not return structured output.
|
||||||
|
|
||||||
@@ -0,0 +1,154 @@
|
|||||||
|
---
|
||||||
|
name: unity-tool-list
|
||||||
|
description: List all Unity-MCP tools registered in the connected Unity Editor instance. Optional regex filter matches against tool name, description, and argument names/descriptions. Use the `includeDescription` / `includeInputs` toggles to control the response size.
|
||||||
|
---
|
||||||
|
|
||||||
|
# Tool / List
|
||||||
|
|
||||||
|
List all Unity-MCP tools registered in the connected Unity Editor instance. Optionally filter by regex across tool names, descriptions, and arguments.
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
- `regexSearch` (optional) — case-insensitive regex with a 200ms execution-timeout guard. Invalid regex throws an `ArgumentException`. Matches name → description → input names → input descriptions.
|
||||||
|
- `includeDescription` (default `false`) — populate each tool's `Description` field.
|
||||||
|
- `includeInputs` (default `None`) — one of `None`, `Inputs` (names only), `InputsWithDescription` (names + descriptions).
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
Iterates `UnityMcpPluginEditor.Instance.Tools.GetAllTools()`, evaluates the filter (if any), and projects each surviving tool into a `ToolInfoData` honoring the verbosity toggles.
|
||||||
|
|
||||||
|
## How to Call
|
||||||
|
|
||||||
|
```bash
|
||||||
|
unity-mcp-cli run-tool unity-tool-list --input '{
|
||||||
|
"regexSearch": "string_value",
|
||||||
|
"includeDescription": "string_value",
|
||||||
|
"includeInputs": "string_value"
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
> For complex input (multi-line strings, code), save the JSON to a file and use:
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool unity-tool-list --input-file args.json
|
||||||
|
> ```
|
||||||
|
>
|
||||||
|
> Or pipe via stdin (recommended):
|
||||||
|
> ```bash
|
||||||
|
> unity-mcp-cli run-tool unity-tool-list --input-file - <<'EOF'
|
||||||
|
> {"param": "value"}
|
||||||
|
> EOF
|
||||||
|
> ```
|
||||||
|
|
||||||
|
|
||||||
|
### Troubleshooting
|
||||||
|
|
||||||
|
If `unity-mcp-cli` is not found, either install it globally (`npm install -g unity-mcp-cli`) or use `npx unity-mcp-cli` instead.
|
||||||
|
Read the /unity-initial-setup skill for detailed installation instructions.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
| Name | Type | Required | Description |
|
||||||
|
|------|------|----------|-------------|
|
||||||
|
| `regexSearch` | `string` | No | Regex pattern to filter tools. Matches against tool name, description, and argument names and descriptions. |
|
||||||
|
| `includeDescription` | `any` | No | Include tool descriptions in the result. Default: false |
|
||||||
|
| `includeInputs` | `any` | No | Include input arguments in the result. Default: None |
|
||||||
|
|
||||||
|
### Input JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"regexSearch": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"includeDescription": {
|
||||||
|
"$ref": "#/$defs/System.Boolean"
|
||||||
|
},
|
||||||
|
"includeInputs": {
|
||||||
|
"$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tool-InputRequest"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"System.Boolean": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"com.IvanMurzak.Unity.MCP.Editor.API.Tool_Tool-InputRequest": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"None",
|
||||||
|
"Inputs",
|
||||||
|
"InputsWithDescription"
|
||||||
|
],
|
||||||
|
"description": "Specifies what to include for tool input arguments."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
### Output JSON Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"result": {
|
||||||
|
"$ref": "#/$defs/AIGD.ToolInfoData-1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"$defs": {
|
||||||
|
"AIGD.ToolInfoData": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Tool name."
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Tool description."
|
||||||
|
},
|
||||||
|
"inputs": {
|
||||||
|
"$ref": "#/$defs/AIGD.ToolInputData-1",
|
||||||
|
"description": "Tool input arguments."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": "MCP tool information."
|
||||||
|
},
|
||||||
|
"AIGD.ToolInputData-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.ToolInputData",
|
||||||
|
"description": "MCP tool input argument."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AIGD.ToolInputData": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Argument name."
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Argument description."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": "MCP tool input argument."
|
||||||
|
},
|
||||||
|
"AIGD.ToolInfoData-1": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/$defs/AIGD.ToolInfoData",
|
||||||
|
"description": "MCP tool information."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"result"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections;
|
||||||
using GameFramework;
|
using GameFramework;
|
||||||
namespace IndianOceanAssets.Engine2_5D
|
namespace IndianOceanAssets.Engine2_5D
|
||||||
{
|
{
|
||||||
@@ -20,8 +21,21 @@ namespace IndianOceanAssets.Engine2_5D
|
|||||||
[SerializeField]
|
[SerializeField]
|
||||||
private bool isPlayer; // Is this the player?
|
private bool isPlayer; // Is this the player?
|
||||||
|
|
||||||
|
[Header("消隐特效")]
|
||||||
|
[Tooltip("死亡消隐使用的溶解材质(Custom/SpriteDissolve shader)")]
|
||||||
|
[SerializeField] private Material dissolveMaterial;
|
||||||
|
|
||||||
|
[Tooltip("消隐动画持续时间(秒)")]
|
||||||
|
[SerializeField] private float fadeDuration = 2f;
|
||||||
|
|
||||||
private bool _isDead = false; // 防止重复触发死亡
|
private bool _isDead = false; // 防止重复触发死亡
|
||||||
|
|
||||||
|
/// <summary>是否已死亡(只读)</summary>
|
||||||
|
public bool IsDead => _isDead;
|
||||||
|
|
||||||
|
/// <summary>最大血量(只读)</summary>
|
||||||
|
public int MaxHealth => maxHealth;
|
||||||
|
|
||||||
// Initializes health
|
// Initializes health
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
@@ -64,7 +78,67 @@ namespace IndianOceanAssets.Engine2_5D
|
|||||||
// Handles death logic and effects
|
// Handles death logic and effects
|
||||||
public void Die()
|
public void Die()
|
||||||
{
|
{
|
||||||
|
if (deathEffect != null)
|
||||||
Instantiate(deathEffect, transform.position + new Vector3(0f, .5f, 0f), Quaternion.identity);
|
Instantiate(deathEffect, transform.position + new Vector3(0f, .5f, 0f), Quaternion.identity);
|
||||||
|
|
||||||
|
// 如果有溶解材质,播放消隐动画后再销毁
|
||||||
|
if (dissolveMaterial != null)
|
||||||
|
{
|
||||||
|
StartCoroutine(DissolveAndDestroy());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Destroy(gameObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 溶解消隐协程:切换材质 → 禁用碰撞/AI → 动画溶解 → 销毁。
|
||||||
|
/// </summary>
|
||||||
|
private IEnumerator DissolveAndDestroy()
|
||||||
|
{
|
||||||
|
// 禁用碰撞体和刚体,防止死亡过程中仍能触发碰撞或受重力下坠
|
||||||
|
foreach (var col in GetComponents<Collider>())
|
||||||
|
col.enabled = false;
|
||||||
|
foreach (var col in GetComponents<Collider2D>())
|
||||||
|
col.enabled = false;
|
||||||
|
foreach (var rb in GetComponents<Rigidbody>())
|
||||||
|
rb.isKinematic = true;
|
||||||
|
foreach (var rb in GetComponents<Rigidbody2D>())
|
||||||
|
rb.isKinematic = true;
|
||||||
|
|
||||||
|
// 禁用所有 MonoBehaviour(AI、动画等),防止死亡后仍移动/攻击
|
||||||
|
foreach (var mb in GetComponents<MonoBehaviour>())
|
||||||
|
{
|
||||||
|
if (mb != this)
|
||||||
|
mb.enabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 切换所有 SpriteRenderer 到溶解材质
|
||||||
|
var renderers = GetComponentsInChildren<SpriteRenderer>();
|
||||||
|
var originalMats = new Material[renderers.Length][];
|
||||||
|
for (int i = 0; i < renderers.Length; i++)
|
||||||
|
{
|
||||||
|
originalMats[i] = renderers[i].materials;
|
||||||
|
renderers[i].materials = new Material[] { new Material(dissolveMaterial) };
|
||||||
|
}
|
||||||
|
|
||||||
|
// 动画溶解
|
||||||
|
float elapsed = 0f;
|
||||||
|
while (elapsed < fadeDuration)
|
||||||
|
{
|
||||||
|
elapsed += Time.deltaTime;
|
||||||
|
float t = Mathf.Clamp01(elapsed / fadeDuration);
|
||||||
|
|
||||||
|
for (int i = 0; i < renderers.Length; i++)
|
||||||
|
{
|
||||||
|
if (renderers[i] != null && renderers[i].material != null)
|
||||||
|
renderers[i].material.SetFloat("_DissolveAmount", t);
|
||||||
|
}
|
||||||
|
|
||||||
|
yield return null;
|
||||||
|
}
|
||||||
|
|
||||||
Destroy(gameObject);
|
Destroy(gameObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,19 +30,19 @@ public static class SpiritLanternPrefabCreator
|
|||||||
// SpiritLantern — 灵灯行为脚本
|
// SpiritLantern — 灵灯行为脚本
|
||||||
root.AddComponent<SpiritLantern>();
|
root.AddComponent<SpiritLantern>();
|
||||||
|
|
||||||
// CircleCollider2D — 触发器,检测怪物接触
|
// SphereCollider — 触发器,检测怪物接触(使用3D物理系统匹配敌人的CapsuleCollider)
|
||||||
// 【碰撞检测说明】
|
// 【碰撞检测说明】
|
||||||
// 灵灯是主动检测方:灵灯的 Trigger 检测进入的怪物 Collider2D
|
// 灵灯是主动检测方:灵灯的 Trigger 检测进入的怪物 Collider
|
||||||
// 需确保 Edit > Project Settings > Physics 2D 碰撞矩阵中,
|
// 需确保 Edit > Project Settings > Physics 碰撞矩阵中,
|
||||||
// 灵灯所在 Layer 与怪物 Layer 的交叉项已勾选
|
// 灵灯所在 Layer 与怪物 Layer 的交叉项已勾选
|
||||||
CircleCollider2D collider = root.AddComponent<CircleCollider2D>();
|
SphereCollider collider = root.AddComponent<SphereCollider>();
|
||||||
collider.isTrigger = true;
|
collider.isTrigger = true;
|
||||||
collider.radius = 0.5f;
|
collider.radius = 5f; // 补偿 Transform scale 0.1,实际碰撞半径 = 5 * 0.1 = 0.5
|
||||||
|
|
||||||
// Rigidbody2D — 物理碰撞需要(Trigger 需要至少一方有 Rigidbody)
|
// Rigidbody — 物理碰撞需要(Trigger 需要至少一方有 Rigidbody)
|
||||||
Rigidbody2D rb = root.AddComponent<Rigidbody2D>();
|
Rigidbody rb = root.AddComponent<Rigidbody>();
|
||||||
rb.isKinematic = true;
|
rb.isKinematic = true;
|
||||||
rb.bodyType = RigidbodyType2D.Kinematic;
|
rb.useGravity = false;
|
||||||
|
|
||||||
// 设置 Layer 为 Default
|
// 设置 Layer 为 Default
|
||||||
root.layer = LayerMask.NameToLayer("Default");
|
root.layer = LayerMask.NameToLayer("Default");
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ namespace IndianOceanAssets.Engine2_5D
|
|||||||
[SerializeField] private Transform followTarget;
|
[SerializeField] private Transform followTarget;
|
||||||
[SerializeField] private Transform maskPlane;
|
[SerializeField] private Transform maskPlane;
|
||||||
[SerializeField] private Vector3 maskOffset = new Vector3(0f, 5f, 0f);
|
[SerializeField] private Vector3 maskOffset = new Vector3(0f, 5f, 0f);
|
||||||
[SerializeField] private float planeSize = 50f;
|
|
||||||
|
|
||||||
// Shader Property IDs
|
// Shader Property IDs
|
||||||
private static readonly int LightDataID = Shader.PropertyToID("_LightData");
|
private static readonly int LightDataID = Shader.PropertyToID("_LightData");
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ Material:
|
|||||||
- _EchoRadius: 39.41617
|
- _EchoRadius: 39.41617
|
||||||
- _EchoWidth: 2.5
|
- _EchoWidth: 2.5
|
||||||
- _LightSoftness: 1
|
- _LightSoftness: 1
|
||||||
- _MinBrightness: 0
|
- _MinBrightness: 1
|
||||||
m_Colors:
|
m_Colors:
|
||||||
- _DarknessColor: {r: 0.01, g: 0.01, b: 0.02, a: 1}
|
- _DarknessColor: {r: 0.01, g: 0.01, b: 0.02, a: 1}
|
||||||
- _EchoCenter: {r: -2.4399998, g: -1.5000057, b: 0, a: 0}
|
- _EchoCenter: {r: -2.4399998, g: -1.5000057, b: 0, a: 0}
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
%YAML 1.1
|
||||||
|
%TAG !u! tag:yousandi.cn,2023:
|
||||||
|
--- !u!21 &2100000
|
||||||
|
Material:
|
||||||
|
serializedVersion: 8
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_Name: SpriteDissolve
|
||||||
|
m_Shader: {fileID: 4800000, guid: 329aabb9d7e77d04295a944f844af20e, type: 3}
|
||||||
|
m_Parent: {fileID: 0}
|
||||||
|
m_ModifiedSerializedProperties: 0
|
||||||
|
m_ValidKeywords: []
|
||||||
|
m_InvalidKeywords: []
|
||||||
|
m_LightmapFlags: 4
|
||||||
|
m_EnableInstancingVariants: 0
|
||||||
|
m_DoubleSidedGI: 0
|
||||||
|
m_CustomRenderQueue: -1
|
||||||
|
stringTagMap: {}
|
||||||
|
disabledShaderPasses: []
|
||||||
|
m_LockedProperties:
|
||||||
|
m_SavedProperties:
|
||||||
|
serializedVersion: 3
|
||||||
|
m_TexEnvs:
|
||||||
|
- _MainTex:
|
||||||
|
m_Texture: {fileID: 0}
|
||||||
|
m_Scale: {x: 1, y: 1}
|
||||||
|
m_Offset: {x: 0, y: 0}
|
||||||
|
m_Ints: []
|
||||||
|
m_Floats:
|
||||||
|
- _CastShadow: 0
|
||||||
|
- _DissolveAmount: 0
|
||||||
|
- _DissolveEdgeWidth: 0.08
|
||||||
|
- _DissolveNoiseScale: 10
|
||||||
|
m_Colors:
|
||||||
|
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
- _DissolveEdgeColor: {r: 1, g: 0.8, b: 0.3, a: 1}
|
||||||
|
m_BuildTextureStacks: []
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: XngdtS34U3q7jtUf6N0YEJu6txcsCpUWL91rvDjiR9mHR2rHf2SeiDQ=
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 2100000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -0,0 +1,154 @@
|
|||||||
|
Shader "Custom/SpriteDissolve"
|
||||||
|
{
|
||||||
|
// 敌人死亡消隐 Shader
|
||||||
|
// 基于噪声的溶解效果,带发光边缘
|
||||||
|
Properties
|
||||||
|
{
|
||||||
|
_MainTex ("Texture", 2D) = "white" {}
|
||||||
|
_Color ("颜色", Color) = (1, 1, 1, 1)
|
||||||
|
|
||||||
|
[Header(Dissolve)]
|
||||||
|
_DissolveAmount ("溶解进度", Range(0, 1)) = 0
|
||||||
|
_DissolveEdgeWidth ("边缘宽度", Range(0, 0.3)) = 0.05
|
||||||
|
_DissolveEdgeColor ("边缘颜色", Color) = (1, 0.8, 0.3, 1)
|
||||||
|
_DissolveNoiseScale ("噪声缩放", Float) = 10
|
||||||
|
|
||||||
|
// 阴影设置(保持与项目一致)
|
||||||
|
[MaterialToggle] _CastShadow ("投射阴影", Float) = 0
|
||||||
|
}
|
||||||
|
SubShader
|
||||||
|
{
|
||||||
|
Tags
|
||||||
|
{
|
||||||
|
"RenderPipeline" = "UniversalPipeline"
|
||||||
|
"Queue" = "Transparent"
|
||||||
|
"RenderType" = "Transparent"
|
||||||
|
}
|
||||||
|
|
||||||
|
Blend SrcAlpha OneMinusSrcAlpha
|
||||||
|
ZWrite Off
|
||||||
|
Cull Off
|
||||||
|
|
||||||
|
Pass
|
||||||
|
{
|
||||||
|
Name "SpriteDissolve"
|
||||||
|
|
||||||
|
HLSLPROGRAM
|
||||||
|
#pragma vertex vert
|
||||||
|
#pragma fragment frag
|
||||||
|
|
||||||
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||||
|
|
||||||
|
struct Attributes
|
||||||
|
{
|
||||||
|
float4 positionOS : POSITION;
|
||||||
|
float2 uv : TEXCOORD0;
|
||||||
|
float4 color : COLOR;
|
||||||
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Varyings
|
||||||
|
{
|
||||||
|
float4 positionCS : SV_POSITION;
|
||||||
|
float2 uv : TEXCOORD0;
|
||||||
|
float4 color : COLOR;
|
||||||
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
||||||
|
};
|
||||||
|
|
||||||
|
TEXTURE2D(_MainTex);
|
||||||
|
SAMPLER(sampler_MainTex);
|
||||||
|
|
||||||
|
half4 _Color;
|
||||||
|
half _DissolveAmount;
|
||||||
|
half _DissolveEdgeWidth;
|
||||||
|
half4 _DissolveEdgeColor;
|
||||||
|
float _DissolveNoiseScale;
|
||||||
|
|
||||||
|
// 简单的哈希噪声
|
||||||
|
float hash(float2 p)
|
||||||
|
{
|
||||||
|
float3 p3 = frac(float3(p.xyx) * 0.1031);
|
||||||
|
p3 += dot(p3, p3.yzx + 33.33);
|
||||||
|
return frac((p3.x + p3.y) * p3.z);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 值噪声(平滑插值)
|
||||||
|
float valueNoise(float2 p)
|
||||||
|
{
|
||||||
|
float2 i = floor(p);
|
||||||
|
float2 f = frac(p);
|
||||||
|
f = f * f * (3.0 - 2.0 * f); // smoothstep
|
||||||
|
|
||||||
|
float a = hash(i);
|
||||||
|
float b = hash(i + float2(1, 0));
|
||||||
|
float c = hash(i + float2(0, 1));
|
||||||
|
float d = hash(i + float2(1, 1));
|
||||||
|
|
||||||
|
return lerp(lerp(a, b, f.x), lerp(c, d, f.x), f.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 分形噪声(多层叠加)
|
||||||
|
float fbm(float2 p)
|
||||||
|
{
|
||||||
|
float value = 0.0;
|
||||||
|
float amplitude = 0.5;
|
||||||
|
for (int i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
value += amplitude * valueNoise(p);
|
||||||
|
p *= 2.0;
|
||||||
|
amplitude *= 0.5;
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
Varyings vert(Attributes input)
|
||||||
|
{
|
||||||
|
Varyings output;
|
||||||
|
UNITY_SETUP_INSTANCE_ID(input);
|
||||||
|
UNITY_TRANSFER_INSTANCE_ID(input, output);
|
||||||
|
|
||||||
|
output.positionCS = TransformObjectToHClip(input.positionOS.xyz);
|
||||||
|
output.uv = input.uv;
|
||||||
|
output.color = input.color;
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
half4 frag(Varyings input) : SV_Target
|
||||||
|
{
|
||||||
|
UNITY_SETUP_INSTANCE_ID(input);
|
||||||
|
|
||||||
|
half4 texColor = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv);
|
||||||
|
half4 color = texColor * _Color * input.color;
|
||||||
|
|
||||||
|
// 如果 alpha 太小,直接丢弃
|
||||||
|
if (color.a < 0.01)
|
||||||
|
discard;
|
||||||
|
|
||||||
|
// 计算噪声
|
||||||
|
float noise = fbm(input.uv * _DissolveNoiseScale);
|
||||||
|
|
||||||
|
// 溶解判定
|
||||||
|
float dissolveEdge = smoothstep(
|
||||||
|
_DissolveAmount - _DissolveEdgeWidth,
|
||||||
|
_DissolveAmount + _DissolveEdgeWidth,
|
||||||
|
noise
|
||||||
|
);
|
||||||
|
|
||||||
|
// 完全溶解区域
|
||||||
|
if (noise < _DissolveAmount)
|
||||||
|
discard;
|
||||||
|
|
||||||
|
// 边缘发光
|
||||||
|
half edgeGlow = (1.0 - dissolveEdge) * step(_DissolveAmount, noise);
|
||||||
|
color.rgb += _DissolveEdgeColor.rgb * edgeGlow * _DissolveEdgeColor.a;
|
||||||
|
|
||||||
|
// 整体淡出(溶解后期整体变淡)
|
||||||
|
color.a *= lerp(1.0, 0.3, _DissolveAmount);
|
||||||
|
|
||||||
|
return color;
|
||||||
|
}
|
||||||
|
ENDHLSL
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FallBack "Sprites/Default"
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: DHgW5Hv/AXJ4FVCaTjexQVJQLVXJgr6jZu7Vz9GpO936bn5BeMA1Iv0=
|
||||||
|
ShaderImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
defaultTextures: []
|
||||||
|
nonModifiableTextures: []
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -155,14 +155,13 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
darknessMaterial: {fileID: 2100000, guid: 6dd18d2379aff3040813ab8005b1898a, type: 2}
|
darknessMaterial: {fileID: 2100000, guid: 6dd18d2379aff3040813ab8005b1898a, type: 2}
|
||||||
debugShowAll: 0
|
debugShowAll: 1
|
||||||
minBrightness: 0
|
minBrightness: 0
|
||||||
darknessColor: {r: 0.01, g: 0.01, b: 0.02, a: 1}
|
darknessColor: {r: 0.01, g: 0.01, b: 0.02, a: 1}
|
||||||
lightSoftness: 1
|
lightSoftness: 1
|
||||||
followTarget: {fileID: 0}
|
followTarget: {fileID: 0}
|
||||||
maskPlane: {fileID: 338266643}
|
maskPlane: {fileID: 338266643}
|
||||||
maskOffset: {x: 0, y: 0, z: 0}
|
maskOffset: {x: 0, y: 0, z: 0}
|
||||||
planeSize: 300
|
|
||||||
--- !u!4 &8914096
|
--- !u!4 &8914096
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -2177,7 +2176,7 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
soulIcon: {fileID: 1702223844}
|
soulIcon: {fileID: 1702223844}
|
||||||
soulCountText: {fileID: 0}
|
soulCountText: {fileID: 1966623134}
|
||||||
lifeIcons:
|
lifeIcons:
|
||||||
- {fileID: 638120134}
|
- {fileID: 638120134}
|
||||||
- {fileID: 418448781}
|
- {fileID: 418448781}
|
||||||
@@ -23732,7 +23731,7 @@ MonoBehaviour:
|
|||||||
m_OnCullStateChanged:
|
m_OnCullStateChanged:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
m_Sprite: {fileID: 21300000, guid: 0d5773b80ec8afd4791808534be2cad0, type: 3}
|
m_Sprite: {fileID: 21300000, guid: 6e4b0f3fd19ef6e43bd2b1de2deda712, type: 3}
|
||||||
m_Type: 0
|
m_Type: 0
|
||||||
m_PreserveAspect: 1
|
m_PreserveAspect: 1
|
||||||
m_FillCenter: 1
|
m_FillCenter: 1
|
||||||
@@ -27892,7 +27891,7 @@ MonoBehaviour:
|
|||||||
m_OnCullStateChanged:
|
m_OnCullStateChanged:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
m_Sprite: {fileID: 21300000, guid: 2a44135eb81109c46a745051acf0d174, type: 3}
|
m_Sprite: {fileID: 21300000, guid: 53578ea97fc4e91439f189bf8a6cfc1a, type: 3}
|
||||||
m_Type: 0
|
m_Type: 0
|
||||||
m_PreserveAspect: 1
|
m_PreserveAspect: 1
|
||||||
m_FillCenter: 1
|
m_FillCenter: 1
|
||||||
@@ -30863,7 +30862,7 @@ RectTransform:
|
|||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 1
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 77247845}
|
m_Father: {fileID: 77247845}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
@@ -30891,7 +30890,7 @@ MonoBehaviour:
|
|||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 1966623129}
|
m_GameObject: {fileID: 1966623129}
|
||||||
m_Enabled: 0
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
@@ -30904,10 +30903,10 @@ MonoBehaviour:
|
|||||||
m_OnCullStateChanged:
|
m_OnCullStateChanged:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
m_text:
|
m_text: 0
|
||||||
m_isRightToLeft: 0
|
m_isRightToLeft: 0
|
||||||
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
m_fontAsset: {fileID: 11400000, guid: 7b2d3c4c2e857f14aaa0e7fb9ebab7e5, type: 2}
|
||||||
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
m_sharedMaterial: {fileID: -1264883736430894452, guid: 7b2d3c4c2e857f14aaa0e7fb9ebab7e5, type: 2}
|
||||||
m_fontSharedMaterials:
|
m_fontSharedMaterials:
|
||||||
- {fileID: 1767129619}
|
- {fileID: 1767129619}
|
||||||
m_fontMaterial: {fileID: 1767129619}
|
m_fontMaterial: {fileID: 1767129619}
|
||||||
@@ -30933,8 +30932,8 @@ MonoBehaviour:
|
|||||||
m_faceColor:
|
m_faceColor:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
rgba: 4294967295
|
rgba: 4294967295
|
||||||
m_fontSize: 74
|
m_fontSize: 71.6
|
||||||
m_fontSizeBase: 74
|
m_fontSizeBase: 71.6
|
||||||
m_fontWeight: 400
|
m_fontWeight: 400
|
||||||
m_enableAutoSizing: 0
|
m_enableAutoSizing: 0
|
||||||
m_fontSizeMin: 18
|
m_fontSizeMin: 18
|
||||||
|
|||||||
@@ -694,6 +694,8 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
gameState: 0
|
gameState: 0
|
||||||
|
lightShrinkDuration: 2
|
||||||
|
lostFadeOutDuration: 1
|
||||||
lightExpandDuration: 1.5
|
lightExpandDuration: 1.5
|
||||||
lightExpandTargetRadius: 20
|
lightExpandTargetRadius: 20
|
||||||
fadeOutDuration: 1
|
fadeOutDuration: 1
|
||||||
@@ -1247,12 +1249,8 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: ae410525a1083304f99715898b5338e5, type: 3}
|
m_Script: {fileID: 11500000, guid: ae410525a1083304f99715898b5338e5, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
selectSFX:
|
selectSFX: {fileID: 0}
|
||||||
audioClip: {fileID: 8300000, guid: 370972ec1bb4cc64e8a96ce64057334c, type: 3}
|
submitSFX: {fileID: 0}
|
||||||
volume: 1
|
|
||||||
submitSFX:
|
|
||||||
audioClip: {fileID: 8300000, guid: 6940b0d02566470418c2e593a6ff04c7, type: 3}
|
|
||||||
volume: 1
|
|
||||||
--- !u!1 &875024152
|
--- !u!1 &875024152
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -3862,7 +3860,7 @@ Canvas:
|
|||||||
m_OverridePixelPerfect: 0
|
m_OverridePixelPerfect: 0
|
||||||
m_SortingBucketNormalizedSize: 0
|
m_SortingBucketNormalizedSize: 0
|
||||||
m_VertexColorAlwaysGammaSpace: 0
|
m_VertexColorAlwaysGammaSpace: 0
|
||||||
m_AdditionalShaderChannelsFlag: 0
|
m_AdditionalShaderChannelsFlag: 25
|
||||||
m_UpdateRectTransformForStandalone: 0
|
m_UpdateRectTransformForStandalone: 0
|
||||||
m_SortingLayerID: 0
|
m_SortingLayerID: 0
|
||||||
m_SortingOrder: 10001
|
m_SortingOrder: 10001
|
||||||
@@ -4014,7 +4012,7 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
soulIcon: {fileID: 438331633}
|
soulIcon: {fileID: 438331633}
|
||||||
soulCountText: {fileID: 437831458}
|
soulCountText: {fileID: 0}
|
||||||
lifeIcons:
|
lifeIcons:
|
||||||
- {fileID: 670078144}
|
- {fileID: 670078144}
|
||||||
- {fileID: 1117279259}
|
- {fileID: 1117279259}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 9.9 KiB |
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: Dy4asi2uAXPSRLtfrAXmNGo8rX/KQN2CcdpDaGMA4CgXobkltjbRQ8w=
|
guid: CnkasiL4AnIXKHpzla4mCR9uO0t74g/sF/nOx1EMdKve+q+dqG0KN8A=
|
||||||
TextureImporter:
|
TextureImporter:
|
||||||
internalIDToNameTable: []
|
internalIDToNameTable: []
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
@@ -112,48 +112,6 @@ TextureImporter:
|
|||||||
ignorePlatformSupport: 0
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: Android
|
|
||||||
maxTextureSize: 2048
|
|
||||||
maxPlaceholderSize: 32
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
ignorePlatformSupport: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: HMIAndroid
|
|
||||||
maxTextureSize: 2048
|
|
||||||
maxPlaceholderSize: 32
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
ignorePlatformSupport: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: OpenHarmony
|
|
||||||
maxTextureSize: 2048
|
|
||||||
maxPlaceholderSize: 32
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
ignorePlatformSupport: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
|
After Width: | Height: | Size: 51 KiB |
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: DSsbsSuuVi58o7D3QwqOseqio8g1ATIkYVOwcZk70qbC8UtJT5u9diM=
|
guid: CS8b5yr7UC2oP9/o+YSbdAyXctWdoeaSPwLy6JKTBjPaGBTBSFCLwtU=
|
||||||
TextureImporter:
|
TextureImporter:
|
||||||
internalIDToNameTable: []
|
internalIDToNameTable: []
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
@@ -112,48 +112,6 @@ TextureImporter:
|
|||||||
ignorePlatformSupport: 0
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: Android
|
|
||||||
maxTextureSize: 2048
|
|
||||||
maxPlaceholderSize: 32
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
ignorePlatformSupport: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: HMIAndroid
|
|
||||||
maxTextureSize: 2048
|
|
||||||
maxPlaceholderSize: 32
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
ignorePlatformSupport: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: OpenHarmony
|
|
||||||
maxTextureSize: 2048
|
|
||||||
maxPlaceholderSize: 32
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
ignorePlatformSupport: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
|
Before Width: | Height: | Size: 44 KiB |
@@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: CCgd4Sn+VyhSX6Sy1vJRD19RHy1W+JPDmy9XAVXah14m2R0Z1sqGCZw=
|
||||||
|
NativeFormatImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
mainObjectFileID: 11400000
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||