unity_export
Export the open page's three.js scene at its current frame as a Unity 6 project with GLB assets, scene-building scripts, GameState, and a PORTING.md guide for manual gameplay porting.
Instructions
Writes the open page's three.js scene, at the frame it is on, as a Unity 6 project: the GLB (three's GLTFExporter: meshes, hierarchy, names, PBR materials and textures, lights, animations, skins, instancing, the camera), glTFast as its importer, an editor script that builds the Unity scene from it on the first open (hidden objects, background, fog, ambient light), GameState.cs from __game.observe(), and PORTING.md: what does not carry over (custom shaders, sprites, compressed and canvas textures, environment maps; named in the reply) and what to port by hand (game loop, input, physics, UI, sound). Gameplay code is not converted. The GLB is loaded back in the page and counted; Unity is not run.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "unity_export"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| out | No | The Unity project's folder, relative to the open project's folder (paprika3d/unity/<Name> by default); exporting again replaces the GLB and scripts and keeps the rest. | |
| game | No | The name the game was opened under with the `open` tool, to act on ("main" by default; a subagent uses its own). | |
| name | No | The Unity asset folder and scene name (describe().name, or the project folder's, by default). |