unity_script_create
Creates a new C# script file in the Unity project at a specified asset path with provided source code content.
Instructions
Create a new C# script file in the project with the given content.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>",
"content": "<content>"
},
"name": "unity_script_create"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Asset path for the script (e.g. 'Assets/Scripts/PlayerController.cs') | |
| port | No | Unity instance port (from unity_select_instance). Always include it when multiple instances run. | |
| content | Yes | Full C# source code content | |
| className | No | Class name (defaults to filename without extension) | |
| overwrite | No | Replace an existing script (default false). Use unity_script_update to edit. |