3.7 KiB
3.7 KiB
name, description
| name | description |
|---|---|
| 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. |
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.
How to Call
HTTP API (Direct Tool Execution)
Execute this tool directly via the MCP Plugin HTTP API:
curl -X POST http://localhost:8080/api/tools/editor-application-set-state \
-H "Content-Type: application/json" \
-d '{
"isPlaying": false,
"isPaused": false
}'
With Authorization (if required)
curl -X POST http://localhost:8080/api/tools/editor-application-set-state \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"isPlaying": false,
"isPaused": false
}'
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
{
"type": "object",
"properties": {
"isPlaying": {
"type": "boolean",
"description": "If true, the \u0027playmode\u0027 will be started. If false, the \u0027playmode\u0027 will be stopped."
},
"isPaused": {
"type": "boolean",
"description": "If true, the \u0027playmode\u0027 will be paused. If false, the \u0027playmode\u0027 will be resumed."
}
}
}
Output
Output JSON Schema
{
"type": "object",
"properties": {
"result": {
"$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.Tool_Editor\u002BEditorStatsData",
"description": "Available information about \u0027UnityEditor.EditorApplication\u0027."
}
},
"$defs": {
"com.IvanMurzak.Unity.MCP.Editor.API.Tool_Editor\u002BEditorStatsData": {
"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 \u0027UnityEditor.EditorApplication\u0027."
}
},
"required": [
"result"
]
}