Execute Code
execute_codeExecute C# code in Unity Editor instantly via Roslyn, bypassing recompilation. Restricts access to file, network, and process APIs, and auto-wraps bare statements for quick iteration.
Instructions
Execute C# code in Unity Editor via Roslyn. 10-40x faster than recompile. Security: no System.IO, System.Net, System.Diagnostics. Bare statements are auto-wrapped in a static class — no boilerplate needed. Example: "var go = new GameObject("Test"); return go.name;"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | C# code to execute in the Unity Editor context | |
| undo_label | No | Label for the Undo group entry (default 'execute_code') | execute_code |