Documentation
Installation
Install Unity API Communicator via the Unity Package Manager:
- Open Window > Package Manager
- Click + > Add package from disk...
- Select
package.jsonfrom the UAC folder - Server starts automatically on port 7777
Quick Start
Test the API with a simple curl command:
curl http://localhost:7777/api/status
Response:
{
"success": true,
"data": {
"server": "Unity API Communicator",
"version": "1.2.0",
"unity": "2021.3.0f1"
}
}
Configuration
Open Tools > Editor API Communicator > Server Settings to configure:
| Setting | Default | Description |
|---|---|---|
Host |
localhost | Server address (* for all interfaces) |
Port |
7777 | Server port |
Auto Start |
true | Start server when Unity opens |
Enable CORS |
true | Allow cross-origin requests |
Discovery API
Discover all available endpoints programmatically:
GET /api/discover
Returns all available endpoints with their methods and descriptions.
curl http://localhost:7777/api/discover
GET /api/categories
Returns list of endpoint categories.
curl http://localhost:7777/api/categories
POST /api/help
Get detailed help for a specific endpoint.
curl -X POST http://localhost:7777/api/help \
-H "Content-Type: application/json" \
-d '{"path": "/api/gameobject/create"}'
GameObject API
POST /api/gameobject/create
Create a new GameObject.
curl -X POST http://localhost:7777/api/gameobject/create \
-H "Content-Type: application/json" \
-d '{
"name": "MyCube",
"type": "Cube",
"x": 0, "y": 1, "z": 0
}'
GET /api/gameobject/list
List all GameObjects in scene.
POST /api/gameobject/transform
Transform a GameObject (position, rotation, scale).
curl -X POST http://localhost:7777/api/gameobject/transform \
-H "Content-Type: application/json" \
-d '{
"name": "MyCube",
"x": 5, "y": 2, "z": 0,
"scaleX": 2, "scaleY": 2, "scaleZ": 2
}'
POST /api/gameobject/delete
Delete a GameObject by name.
Scene API
POST /api/scene/new
Create a new scene.
POST /api/scene/save
Save current scene.
GET /api/scene/list
List all scenes in project.
Terrain API PRO
17 endpoints for procedural terrain generation.
POST /api/terrain/create
Create a new terrain.
curl -X POST http://localhost:7777/api/terrain/create \
-H "Content-Type: application/json" \
-d '{
"name": "MyTerrain",
"width": 500,
"height": 300,
"length": 500
}'
POST /api/terrain/height/noise
Apply Perlin noise heightmap.
POST /api/terrain/paint
Paint terrain textures.
POST /api/terrain/trees/add
Add trees to terrain.
POST /api/terrain/grass/add
Add grass details.
Execute API PRO
Call any static method via reflection.
curl -X POST http://localhost:7777/api/execute \
-H "Content-Type: application/json" \
-d '{
"className": "UnityEditor.PlayerSettings",
"methodName": "get_productName"
}'
AI Integration Guide
For AI agents (Claude, ChatGPT, Copilot), always start by discovering available endpoints:
# 1. Discover all endpoints
curl http://localhost:7777/api/discover
# 2. Get categories
curl http://localhost:7777/api/categories
# 3. Get help for specific endpoint
curl -X POST http://localhost:7777/api/help \
-d '{"path": "/api/terrain/create"}'