### Install opencode CLI Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/SETUP.md Installation script for macOS and Linux environments. ```bash # Install (macOS/Linux) curl -fsSL https://opencode.ai/install | bash # Verify opencode --version ``` -------------------------------- ### Install Goose CLI Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/SETUP.md Installation via Homebrew or official documentation. ```bash # Install brew install block/tap/goose # or see https://block.github.io/goose/ # Verify goose --version ``` -------------------------------- ### Install GitHub Copilot CLI Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/SETUP.md Requires the GitHub CLI to be installed beforehand. ```bash # Install the GitHub CLI first: https://cli.github.com/ # Then install the Copilot extension gh extension install github/gh-copilot # Verify copilot --version ``` -------------------------------- ### Unity ACP Tool Usage Examples Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/README.md Demonstrates the syntax for invoking specific tool actions within the agent interface. ```text unity_scene(action="modify_component", gameObjectPath="Player", ...) unity_asset(action="find_references", assetPath="Assets/Materials/Wood.mat") unity_generate(action="text_to_3d", prompt="a medieval wooden chair") unity_tool(name="list") → shows all 62 available tool names ``` -------------------------------- ### Install Gemini CLI Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/SETUP.md Available via npm or pip; ensure the API key is set in environment variables if required. ```bash # Install npm install -g @anthropic-ai/gemini-cli # or pip install gemini-cli # Verify gemini --version ``` -------------------------------- ### Agent Interaction Examples Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/SETUP.md Example interactions demonstrating how the agent uses vision tools. ```text You: "What's in this room?" Agent: unity_spatial(action="detect_objects") → "Detected 5 objects: chair (94%), table (91%), potted plant (87%), tv (82%), couch (79%)" You: "How deep is the scene?" Agent: unity_spatial(action="estimate_depth") → "Depth Analysis: Min: 0.12, Max: 0.95, Avg: 0.48 Near zone: 23% of pixels Mid zone: 45% of pixels Far zone: 32% of pixels" You: "Give me a full analysis of this view" Agent: unity_spatial(action="describe_view") → Combined: objects + depth + camera position/rotation/FOV ``` -------------------------------- ### Clone Unity Agent Client Repository Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/SETUP.md Use this command to download the repository for a fresh installation. ```bash git clone https://github.com/3DLabInstruments/UnityACPClient.git ``` -------------------------------- ### Configure Mock Agent Command Arguments Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/ELICITATION_TEST_GUIDE.md Example arguments for the Unity Agent Client settings to point to the mock elicitation agent script. ```json ["/docs/samples/mock-elicitation-agent.js"] ``` ```json ["E:/repo/UnityAgentClient/docs/samples/mock-elicitation-agent.js"] ``` -------------------------------- ### Test AI Agent Prompts Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/SETUP.md Example prompts to verify the AI agent's vision capabilities. ```text "Detect objects in the current camera view" "Analyze the depth in this scene" "Describe what the camera can see" ``` -------------------------------- ### Install Codex CLI ACP Adapter Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/SETUP.md Installs the adapter required for Codex CLI integration. ```bash # Install the adapter (follow the repo README) npm install -g codex-acp ``` -------------------------------- ### Technical vs Semantic Capability API Examples Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/ARCHITECTURE.md Comparison between low-level technical parameters and high-level semantic parameters for agent tool calls. ```text Technical (low-level): unity_scene(action="modify_component", gameObjectPath="Camera", componentType="Transform", propertyName="m_LocalPosition", value="3,2,1") Semantic (implemented): unity_scene(action="place_on_ground", gameObjectPath="Chair") unity_scene(action="find_by_criteria", tag="Enemy", layer="Default") unity_scene(action="describe") unity_lighting(action="setup_time_of_day", timeOfDay="sunset") unity_particle(action="set_main", startColor="1,0.5,0,1", startSize=2) unity_terrain(action="modify_height", mode="raise", x=50, z=50, radius=10) ``` -------------------------------- ### Install Claude Code ACP Adapter Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/SETUP.md Installs the necessary adapter to enable ACP communication for Claude Code. ```bash # Install the adapter (follow the repo README) npm install -g claude-code-acp ``` -------------------------------- ### Represent Intent Parsing Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/ARCHITECTURE.md Example of how the AI Agent interprets natural language user input into structured goals. ```text User: "帮我搭一个中世纪酒馆场景,里面要有桌椅和蜡烛" ↓ Agent understands: create a medieval tavern scene with tables, chairs, and candles ``` -------------------------------- ### Batch Execution JSON Structure Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/ARCHITECTURE.md Example of a batch operation request using the unity_batch tool to perform multiple atomic actions in one round-trip. ```json { "tool": "unity_batch", "operations": [ { "tool": "unity_scene", "action": "add_gameobject", "name": "Ball", "primitiveType": "Sphere", "position": "0,3,0" }, { "tool": "unity_material", "action": "assign", "gameObjectPath": "Ball", "color": "0,0,1,1" } ] } ``` -------------------------------- ### Define Skill Template Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/ARCHITECTURE.md YAML definition for a parameterized skill template used by the Unity Client to guide agent workflows. ```yaml name: create_colored_object description: Create a primitive with a specific color params: [objectName, shape, color, position] steps: - tool: unity_scene action: add_gameobject params: { name: "{{objectName}}", primitiveType: "{{shape}}", position: "{{position}}" } - tool: unity_material action: assign params: { gameObjectPath: "{{objectName}}", color: "{{color}}" } ``` -------------------------------- ### Verify Agent Functionality with Test Prompts Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/SETUP.md Use these sample prompts to confirm the agent is correctly connected and responding to basic Unity project queries. ```text "Show me the scene hierarchy" "What are the project settings?" "List all scenes in the project" "Show me the recent console logs" ``` -------------------------------- ### Clone the Repository Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/CONTRIBUTING.md Initial command to clone the project repository. ```bash git clone https://github.com/yetsmarch-sina/UnityAgentClient.git # Open in Unity Hub → Window > Unity Agent Client > AI Agent ``` -------------------------------- ### Implement IMcpTool Interface Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/CONTRIBUTING.md Template for creating a custom tool by implementing the IMcpTool interface. ```csharp using System.Text.Json; using UnityEditor; using UnityEngine; namespace UnityAgentClient { public class MyCustomTool : IMcpTool { public string Name => "my_custom_tool"; public string Description => "One-line description of what this tool does."; public bool RequiresMainThread => true; // true if using Unity Editor API public JsonElement InputSchema => JsonDocument.Parse(@"{ "type": "object", "properties": { "target": { "type": "string", "description": "Path to the target GameObject" }, "value": { "type": "number", "description": "The value to set" } }, "required": ["target"] }").RootElement; public McpToolResult Execute(JsonElement args) { // 1. Parse arguments var target = args.GetProperty("target").GetString(); var go = GameObject.Find(target); if (go == null) return McpToolResult.Error($"GameObject not found: {target}"); // 2. Do the work (use Undo for reversibility) Undo.RecordObject(go.transform, "My Custom Tool"); // ... your logic here ... // 3. Return result as text return McpToolResult.Success($"Done! Modified {target}"); } } } ``` -------------------------------- ### Verify Tool Visibility Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/SETUP.md Execute this command to list available tools and ensure the agent can correctly interface with Unity. ```python unity_tool(name="list") ``` -------------------------------- ### Build a Scene from Natural Language Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/DEMOS.md Demonstrates the agent's ability to execute a sequence of tool calls to construct an environment from a single prompt. ```text You: Please help me build a simple outdoor scene: a green ground with three trees and two rocks, and set it to evening lighting. (Agent will call ~8 tools in sequence: 1. create_object → Plane (ground), scale 10, green color 2-4. create_object → 3x Cylinder (trees), brown + green spheres on top 5-6. create_object → 2x Sphere (rocks), grey color, random positions 7. setup_time_of_day → "sunset" preset 8. save) ``` -------------------------------- ### Implement a custom Atomic Tool Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/ARCHITECTURE.md Create a class implementing IMcpTool to expose Unity functionality to the agent. Register the implementation in BuiltinMcpServer.RegisterTools(). ```csharp public class MyTool : IMcpTool { public string Name => "my_custom_tool"; public string Description => "What it does"; public bool RequiresMainThread => true; public JsonElement InputSchema => /* ... */; public McpToolResult Execute(JsonElement args) { // Unity API calls return McpToolResult.Success("Done"); } } ``` -------------------------------- ### Voice-Level Scene Building Scenario Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/USE_CASES.md Demonstrates automated scene construction based on natural language input. ```text You: "Create a horror game scene: a hallway with a door at the end, 3 lights but only 1 is on, overall very dark" AI executes automatically (< 10 seconds): 1. scene_add_gameobject → Create hallway (stretched Cube) 2. scene_add_gameobject → Create door (Cube) 3. scene_add_gameobject × 3 → 3 lights 4. scene_modify_component → Disable 2 lights 5. get_render_settings → Dim ambient light The scene ACTUALLY appears in the Unity editor. ``` -------------------------------- ### Lighting Mood Transitions Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/DEMOS.md Demonstrates rapid lighting adjustments using natural language prompts to trigger time-of-day settings. ```text You: Set the lighting to morning (warm sunrise, soft shadows) You: Now switch to night (dark blue ambient, moonlight directional) You: Overcast (grey flat lighting, no harsh shadows) You: Sunset (orange/pink sky, long shadows) You: Back to noon (bright white, minimal shadows) ``` -------------------------------- ### Implement Custom MCP Tool Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/README.md Template for creating a custom tool by implementing the IMcpTool interface. Requires registration in BuiltinMcpServer. ```csharp public class MyTool : IMcpTool { public string Name => "my_custom_tool"; public string Description => "Does something useful"; public bool RequiresMainThread => true; // true if using Unity API public JsonElement InputSchema => JsonDocument.Parse(@"{ ""type"": ""object"", ""properties"": {} }").RootElement; public McpToolResult Execute(JsonElement args) { // Your Unity API calls here return McpToolResult.Success("Result text"); } } ``` -------------------------------- ### Project Structure Overview Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/CONTRIBUTING.md Visual representation of the file organization within the Unity project. ```text Assets/UnityAgentClient/Editor/ ├── AgentWindow.cs ← UI (chat window, ACP protocol handling) ├── BuiltinMcpServer.cs ← Tool registration & MCP server ├── CoreBootstrap.cs ← Wires Core DLL to Unity APIs ├── Mcp*Tools.cs (×15 files) ← 80+ tool implementations ← YOUR TOOLS GO HERE ├── MarkdownVisualBuilder.cs ← Markdown → UI Toolkit renderer ├── AgentWindow.uss ← Styles ├── Elicitation/ ← Structured input forms └── server.js ← stdio proxy for agents ``` -------------------------------- ### Particle System Modification Prompt Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/DEMOS.md Demonstrates a follow-up prompt to modify existing particle system parameters and add new effects. ```text You: Make it more intense — faster, bigger particles, and add some smoke on top (Agent adjusts parameters + creates second particle system for smoke) ``` -------------------------------- ### Download Depth Anything Model Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/SETUP.md Use the Hugging Face hub to download the Depth Anything V2 model. ```bash pip install huggingface_hub python -c " from huggingface_hub import hf_hub_download hf_hub_download('depth-anything/Depth-Anything-V2-Small', 'depth_anything_v2_vits.onnx', local_dir='.') " ``` -------------------------------- ### unity_lighting Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/README.md Provides operations for managing scene lighting and environment settings. ```APIDOC ## unity_lighting ### Description Modify lighting, skybox, fog, and lightmap settings. ### Actions - **get_settings**: Get ambient light, skybox, fog, lightmap settings, and all scene lights - **set_ambient**: Modify ambient color, intensity, fog enable/color/density - **bake**: Bake lightmaps for the active scene ``` -------------------------------- ### Batch Parameter Tuning Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/USE_CASES.md Illustrates efficient bulk modification of object components across a scene. ```text You: "Change all Enemies' movement speed from 5 to 8 and health from 100 to 150" AI executes: 1. scene_find_by_component("EnemyController") → Found 12 objects 2. scene_modify_component × 12 → Update Speed 3. scene_modify_component × 12 → Update Health AI: "Updated 12 Enemy objects: Speed 5→8, Health 100→150" ``` -------------------------------- ### Particle System Generation Sequence Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/DEMOS.md Shows the initial prompt sequence for creating a fire particle effect using agent tool calls. ```text You: Create a fire particle effect in the center of the scene (Agent will: 1. create_object → Empty "FireEffect" with ParticleSystem 2. set_main → duration=5, loop=true, startLifetime=1.5, startSpeed=3, startSize=0.5 3. set_emission → rateOverTime=50 4. set_shape → cone, angle=25, radius=0.3 5. set_color → gradient from yellow to orange to transparent 6. set_size → curve decreasing over lifetime 7. preview → play) ``` -------------------------------- ### Generate and Place 3D Assets Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/DEMOS.md Shows the workflow for generating 3D models using external AI services and placing them into the scene via chat commands. ```text You: Generate a medieval wooden chair using Meshy AI, then place it in the center of the room (Agent will: 1. unity_generate(action="text_to_3d", prompt="medieval wooden chair, game asset") 2. Poll task status until complete 3. instantiate_prefab → place the generated model 4. set_transform → position at center (0, 0, 0)) ``` ```text You: Now generate a matching wooden table, and put it next to the chair ``` -------------------------------- ### Non-Coder Game Prototyping Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/USE_CASES.md Shows how non-technical users can perform complex tasks like UI creation and pathfinding via natural language. ```text Designer/Artist: "I don't write code, but I want to try Unity" "Add a button that makes the character jump when clicked" → AI creates UI Button + binds event + adds jump logic "Make this object red" → AI directly changes the Material "Make this character walk to that point" → AI bakes NavMesh + sets up pathfinding ``` -------------------------------- ### Define a Skill Recipe in YAML Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/CONTRIBUTING.md Create a new skill by defining steps and parameters in a YAML file located in UserSettings/UnityAgentClient/Skills/. ```yaml name: setup_outdoor_scene description: Create a basic outdoor scene with terrain, trees, and lighting parameters: - name: style description: Visual style (realistic, stylized, low-poly) default: realistic steps: - description: Create a Terrain tool: unity_scene action: create_object notes: Use 'Terrain' type with default settings - description: Add trees to the terrain tool: unity_scene action: create_object notes: Add 5-10 tree objects as children of the terrain - description: Set up outdoor lighting tool: unity_lighting action: setup_time_of_day notes: Use 'noon' preset for bright outdoor lighting ``` -------------------------------- ### Advertise Elicitation Capabilities Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/ARCHITECTURE.md Include this object in the ClientCapabilities.Meta during the initialize phase to signal support for elicitation forms and URL modes. ```jsonc // Sent in initialize → ClientCapabilities.Meta { "elicitation": { "form": {}, "url": {} } } ``` -------------------------------- ### Register Tool in BuiltinMcpServer Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/CONTRIBUTING.md Steps to register the new tool instance within the server's tool collection. ```csharp // In the tool instantiation section: var myCustomTool = new MyCustomTool(); // In the allTools array: var allTools = new IMcpTool[] { // ... existing tools ... myCustomTool, // ← add here }; ``` -------------------------------- ### Execute Unity Skill Commands Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/README.md Commands for interacting with the skill system to list, search, or retrieve specific skill recipes. ```text unity_skill(action="list") → list all available skills unity_skill(action="search", query="button") → search by keyword unity_skill(action="get", name="create_ui_button") → get full recipe ``` -------------------------------- ### Register a Capability group Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/ARCHITECTURE.md Group tools into a MetaToolRouter and register it within BuiltinMcpServer.RegisterTools(). ```csharp var myCategory = new MetaToolRouter("unity_mycategory", "Description of what this category covers") .AddAction(toolA, "action_a") .AddAction(toolB, "action_b"); McpToolRegistry.Register(myCategory); ``` -------------------------------- ### End-to-end 3D generation flow Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/README.md Demonstrates the sequence of tool calls required to generate a 3D model from a text prompt and instantiate it in the scene. ```text You: "Generate a low-poly medieval chair and place it at position 3,0,5" Agent: 1. unity_generate(action="text_to_3d", prompt="a medieval wooden chair with ornate carvings", artStyle="low-poly", outputFormat="glb") 2. (polls Meshy API for ~30-120 seconds until model is ready) 3. unity_generate(action="instantiate_prefab", prefabPath="Assets/Generated/Meshy/a_medieval_wooden_chair_143022.glb", position="3,0,5") 4. "Done. Medieval chair generated and placed at (3, 0, 5)." ``` -------------------------------- ### unity_tool Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/README.md Direct access fallback for invoking specific tools by name. ```APIDOC ## unity_tool ### Description Allows direct invocation of tools when the specific tool name is known or to bypass meta-tool routing. ### Example - `unity_tool(name="list")` - `unity_tool(name="physics_get_settings")` ``` -------------------------------- ### Scene Inspector Query Sequence Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/DEMOS.md Demonstrates the sequence of natural language prompts and corresponding agent tool calls for querying scene objects and component data. ```text You: What's in my scene right now? (Agent calls: describe → structured scene summary) You: Which objects have a Rigidbody component? (Agent calls: find_by_component → lists all physics objects) You: What are the Player's movement settings? (Agent calls: get_hierarchy → finds Player, then get_component_data → reads PlayerMovement component, reports Speed=5, JumpForce=10, etc.) ``` -------------------------------- ### Define a custom Skill Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/ARCHITECTURE.md Create a YAML file in UserSettings/UnityAgentClient/Skills/ to define agent skills using parameterized templates. ```yaml name: my_custom_skill description: What this skill achieves category: scene parameters: - name: objectName description: Name of the object to create steps: - tool: unity_scene action: add_gameobject name: "{{objectName}}" tips: | Additional guidance for the Agent. ``` -------------------------------- ### Direct tool access via unity_tool Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/README.md Provides a fallback mechanism to invoke specific tools directly or list available tools. ```text unity_tool(name="list") → list all 51 tools unity_tool(name="physics_get_settings") → call any tool directly unity_tool(name="config_tags_and_layers") → bypasses meta-tool routing ``` -------------------------------- ### unity_skill(action, ...) Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/README.md Executes skill-related operations including listing available skills, searching by keyword, or retrieving a specific recipe. ```APIDOC ## unity_skill ### Description Manages and executes pre-defined step-by-step guides for Unity tasks. ### Parameters - **action** (string) - Required - The operation to perform: "list", "search", or "get". - **query** (string) - Optional - Keyword for searching skills (used with action="search"). - **name** (string) - Optional - The name of the specific skill to retrieve (used with action="get"). ### Usage Examples - unity_skill(action="list") - unity_skill(action="search", query="button") - unity_skill(action="get", name="create_ui_button") ``` -------------------------------- ### unity_ui Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/README.md Methods for interacting with Unity UI (Canvas/UGUI) elements. ```APIDOC ## unity_ui ### Actions - **get_canvas_hierarchy**: Get specialized UI hierarchy with RectTransform details - **modify_rect_transform**: Modify anchors, pivot, size, and position - **set_text**: Set text content on Text or TextMeshPro - **get_component_data**: Read component properties - **modify_component**: Modify component properties - **set_active**: Set active/inactive status ``` -------------------------------- ### Define Models Directory Structure Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/SETUP.md Required folder structure for storing ONNX models in the Unity project. ```text Assets/ StreamingAssets/ AgentVision/ ← create this folder yolov8m.onnx ← object detection model depth_anything_s.onnx ← depth estimation model ``` -------------------------------- ### Configure Scripting Define Symbols Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/SETUP.md Add these symbols to the Player settings to enable vision features. ```text UNITY_SENTIS ``` ```text UNITY_INFERENCE_ENGINE ``` -------------------------------- ### unity_editor Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/README.md Provides control over the Unity Editor state, playback, and project settings. ```APIDOC ## unity_editor ### Description Control the Unity Editor lifecycle and retrieve project information. ### Actions - **enter_playmode**: Enter Play Mode - **pause_playmode**: Pause / resume Play Mode - **stop_playmode**: Stop Play Mode - **execute_menu_item**: Execute any editor menu command - **get_state**: Get current editor state - **screenshot**: Capture Game view screenshot - **undo**: Undo last N operations - **redo**: Redo last N operations - **get_console_logs**: Read all console log entries - **get_console_errors**: Get only errors and warnings - **get_project_settings**: Get project configuration - **build**: Build the project ``` -------------------------------- ### Terrain Sculpting Prompt Sequence Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/DEMOS.md Demonstrates the sequence of natural language prompts and corresponding agent function calls for terrain modification. ```text You: Create a mountain in the center of the terrain, about 50 meters high (Agent calls: modify_height with raise mode, center position, large radius) You: Add a valley on the east side (Agent calls: modify_height with lower mode, east offset) You: Paint grass on the flat areas and rock texture on the mountain slopes (Agent calls: paint_texture for grass on low areas, rock on steep areas) You: Add a cluster of 20 trees around the base of the mountain (Agent calls: add_trees with scattered positions) ``` -------------------------------- ### Core Differentiator Comparison Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/USE_CASES.md Highlights the functional difference between standard AI coding assistants and the Unity Agent Client's direct editor manipulation. ```text GitHub Copilot: AI helps you WRITE code Unity AI: Unity's locked-in AI, costs cloud tokens Unity Agent Client: AI directly OPERATES your Unity editor, any LLM, free ``` -------------------------------- ### unity_spatial Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/README.md Methods for spatial queries, perception, and navigation pathfinding. ```APIDOC ## unity_spatial ### Actions - **check_line_of_sight**: Check if two objects have clear line of sight - **detect_visible_objects**: List all objects visible from a camera - **raycast**: Cast a ray and report hits - **camera_visibility**: Check if a specific object is visible from a camera - **navmesh_query_path**: Calculate navigation path between two points - **inject_texture**: Create a texture from base64/file and apply to a material ``` -------------------------------- ### Configure URL mode parameters Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/ELICITATION.md Parameters required for out-of-band elicitation, such as OAuth flows. ```jsonc "params": { "mode": "url", "elicitationId": "github-oauth-001", "url": "https://agent.example.com/connect?elicitationId=…", "message": "Please authorize…" } ``` -------------------------------- ### unity_animation Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/README.md Methods for managing Animator Controllers and NavMesh navigation. ```APIDOC ## unity_animation ### Actions - **get_controllers**: List all Animator Controllers - **get_states**: Get full state machine structure - **get_parameters**: Read/write Animator Controller parameters - **navmesh_bake**: Bake NavMesh for the active scene - **navmesh_get_settings**: Get NavMesh agent types and area settings ``` -------------------------------- ### unity_scene Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/README.md Provides operations for managing the scene hierarchy, GameObjects, and component data. ```APIDOC ## unity_scene ### Description Perform operations on the Unity scene hierarchy and GameObjects. ### Actions - **get_hierarchy**: Get full GameObject tree with component info - **get_component_data**: Read all serialized properties of any component - **modify_component**: Modify component properties - **add_gameobject**: Create GameObjects - **delete_gameobject**: Delete GameObjects - **save**: Save active scene - **set_selection**: Select GameObjects - **reparent**: Move a GameObject under a different parent - **duplicate**: Duplicate a GameObject - **find_by_component**: Find GameObjects with a specific component - **set_active**: Set a GameObject active or inactive - **rename**: Rename a GameObject - **set_transform**: Set position, rotation, and scale - **open_scene**: Open a scene by path - **set_text**: Set Text/TextMeshPro content - **instantiate_prefab**: Instantiate a prefab - **assign_material**: Assign a material or color to a Renderer ``` -------------------------------- ### Capability API Categories Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/ARCHITECTURE.md List of available capability domains implemented as MetaToolRouter instances. ```text unity_scene — Object lifecycle (create, delete, rename, reparent, find, describe, place) unity_editor — Editor control (play mode, undo/redo, screenshots, console) unity_asset — Asset management (search, import, prefabs) unity_material — Visual styling (create, assign, modify properties) unity_lighting — Lighting & environment (ambient, fog, lightmap baking, time-of-day presets) unity_animation — Animation systems (controllers, state machines) unity_ui — UI operations (Canvas, RectTransform, Text) unity_generate — AI 3D generation (Meshy text-to-3d, image-to-3d) unity_spatial — Spatial intelligence (line-of-sight, visibility, NavMesh) unity_particle — Particle systems (read/modify modules, preview) unity_terrain — Terrain editing (heightmap, texture painting, trees) unity_batch — Cross-category batch execution unity_skill — Skill recipe access unity_tool — Direct atomic tool access (fallback) ``` -------------------------------- ### unity_material Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/README.md Provides operations for managing materials and rendering properties. ```APIDOC ## unity_material ### Description Read and modify material properties and rendering settings. ### Actions - **get_properties**: Read all shader properties of a material - **set_property**: Modify material properties - **assign**: Assign a material to a GameObject's Renderer - **get_render_settings**: Get quality, shadow, and render pipeline settings - **create**: Create a new material with specified shader ``` -------------------------------- ### Structured Input Elicitation Flow Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/DEMOS.md Shows how the agent uses structured forms to gather specific parameters from the user, avoiding ambiguity in free-text interactions. ```text You: Refactor the player controller (Agent sends elicitation/create → a structured form pops up inline: - Dropdown: "Refactoring Strategy" → Conservative / Balanced / Aggressive - Text field: "Additional notes" - Pre-selected default: "Balanced" User picks "Aggressive", types "keep backward compatibility", clicks Submit) (Agent receives typed data {strategy: "aggressive", note: "keep backward compatibility"} and proceeds with the exact parameters — no ambiguity) ``` ```text You: Place a light source in my scene (Agent sends elicitation with Unity-specific formats: - Vector3Field: "Position" → user picks (3, 5, -2) with native Unity input - ColorField: "Light Color" → user picks warm orange via color picker - PopupField: "Light Type" → Point / Spot / Directional User fills the form, clicks Submit → light created with exact parameters) ``` -------------------------------- ### Advertise client capabilities Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/ELICITATION.md The JSON structure used to inform the agent that the client supports form and URL elicitation modes. ```jsonc "clientCapabilities": { "elicitation": { "form": {}, "url": {} } } ``` -------------------------------- ### AI Debugger Workflow Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/USE_CASES.md Demonstrates the AI's ability to diagnose and fix physics-related issues directly in the editor. ```text You: "The player is clipping through walls during gameplay, help me check" AI executes: 1. scene_get_component_data("Player", "Rigidbody") → Check physics 2. scene_get_component_data("Player", "CapsuleCollider") → Check collider 3. editor_get_console_errors → Check errors AI: "Found the issue: Player's Rigidbody.collisionDetectionMode is set to Discrete, but the movement speed is high. Changing to ContinuousDynamic will fix wall clipping. Want me to fix it?" You: "Fix it" AI: scene_modify_component → Done. ``` -------------------------------- ### unity_generate Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/README.md Methods for AI-powered 3D asset generation using Meshy AI. ```APIDOC ## unity_generate ### Actions - **text_to_3d**: Generate a 3D model from a text description - **image_to_3d**: Generate a 3D model from a reference image - **list_tasks**: List recent Meshy generation tasks and their statuses - **instantiate_prefab**: Place the generated model into the scene - **refresh**: Refresh Asset Database after generation ``` -------------------------------- ### unity_asset Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/README.md Provides management operations for project assets. ```APIDOC ## unity_asset ### Description Manage project assets including searching, creation, and modification. ### Actions - **list**: Search assets by path and type - **get_info**: Get asset details, dependencies, labels - **find_references**: Find all assets that reference a given asset - **get_import_settings**: Read asset importer settings - **list_scenes**: List all scenes and build settings - **create_prefab**: Create a prefab from a scene object - **instantiate_prefab**: Instantiate a prefab into the scene - **rename**: Rename an asset - **move**: Move an asset to a different folder - **delete**: Delete an asset - **refresh**: Force Asset Database refresh - **create_folder**: Create project folders - **create_material**: Create a new material ``` -------------------------------- ### Scene Cleanup and Batch Renaming Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/DEMOS.md Shows the agent diagnosing scene issues, such as floating objects, and performing batch operations like grounding and renaming. ```text You: Look at my scene — there are some objects floating in the air, can you place them all on the ground? (Agent will: 1. describe → analyze scene objects 2. find_by_criteria → objects above y=0.5 3. Multiple place_on_ground calls → raycast each object to terrain Reports: "Placed 4 objects on the ground") ``` ```text You: Now rename all the "GameObject (1)", "GameObject (2)" objects to something meaningful based on their shape and position (Agent uses get_hierarchy + rename for each object: "GameObject (1)" → "LeftWall" "GameObject (2)" → "FloorTile_Center" etc.) ``` -------------------------------- ### Define Unity-native Vector3 Schema Property Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/ARCHITECTURE.md Use the unity-vector3 format string to trigger a Vector3Field in the UI, expecting a comma-separated string value. ```jsonc "spawnPosition": { "type": "string", "format": "unity-vector3", "title": "Spawn Position", "default": "0,1,0" } ``` -------------------------------- ### Add Tool to Meta-Tool Category Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/CONTRIBUTING.md Methods for adding a tool to an existing meta-tool router or creating a new category. ```csharp // In the meta-tool section, add to an existing router: var scene = new MetaToolRouter("unity_scene", "...") // ... existing actions ... .AddAction(myCustomTool, "my_action_name"); // ← add here ``` ```csharp var myCategory = new MetaToolRouter("unity_mycategory", "Description of what this category does") .AddAction(myCustomTool, "my_action"); McpToolRegistry.Register(myCategory); ``` -------------------------------- ### Handle elicitation response actions Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/ELICITATION.md The three-action model for responding to an elicitation request, aligned with MCP standards. ```jsonc { "result": { "action": "accept", "content": { /* matches schema */ } } } { "result": { "action": "decline" } } { "result": { "action": "cancel" } } // user closed dialog / Esc ``` -------------------------------- ### Define elicitation/create request Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/ELICITATION.md The structure for initiating an elicitation request, supporting either form-based input or URL-based out-of-band interaction. ```jsonc { "jsonrpc": "2.0", "id": 43, "method": "elicitation/create", "params": { "sessionId": "sess_…", // session-scoped "toolCallId": "tc_…", // optional, ties to a tool call // OR: // "requestId": 12, // request-scoped (pre-session) "mode": "form", // "form" | "url" "message": "…prompt text…", "requestedSchema": { /* restricted JSON Schema */ } } } ``` -------------------------------- ### Export YOLOv8 Model Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/SETUP.md Use the Ultralytics library to export a YOLOv8 model to ONNX format. ```bash pip install ultralytics python -c "from ultralytics import YOLO; YOLO('yolov8m.pt').export(format='onnx', opset=15)" ``` -------------------------------- ### Standalone protocol smoke test Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/ELICITATION_TEST_GUIDE.md Executes a series of JSON-RPC messages against the mock elicitation agent to verify protocol communication. ```powershell @" {"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":1,"clientCapabilities":{"fs":{"readTextFile":true,"writeTextFile":true},"_meta":{"elicitation":{"form":{}}}},"clientInfo":{"name":"test","version":"0.0.1"}}} {"jsonrpc":"2.0","id":2,"method":"session/new","params":{"cwd":"/tmp","mcpServers":[]}} {"jsonrpc":"2.0","id":3,"method":"session/prompt","params":{"sessionId":"mock-session-1","prompt":[{"type":"text","text":"hello"}]}} {"jsonrpc":"2.0","id":1,"result":{"action":"accept","content":{"strategy":"aggressive","note":"do it"}}} "@ | node docs/samples/mock-elicitation-agent.js ``` -------------------------------- ### Verify Elicitation Submission Output Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/ELICITATION_TEST_GUIDE.md Expected JSON output format returned by the agent after submitting the elicitation form. ```json {"strategy":"aggressive","note":"do it"} ``` -------------------------------- ### Sentis Vision Scene Analysis Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/USE_CASES.md Shows how the AI interprets the game view using computer vision and provides design feedback. ```text You: "Look at the current camera view and tell me what's wrong" AI executes: 1. vision_detect_objects → "3 persons, 2 chairs detected" 2. vision_estimate_depth → "foreground 30%, midground 45%, background 25%" 3. editor_get_console_errors → "2 warnings: Missing Rigidbody" AI: "The scene has 3 characters and 2 chairs. Two characters are missing Rigidbody components so they won't be affected by physics. The background area (25%) is empty — consider adding environment elements to fill the depth." ``` -------------------------------- ### Represent Task Graph Structure Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/ARCHITECTURE.md Conceptual representation of how an intent is decomposed into parallel and sequential execution tasks. ```text Intent: "Build a medieval tavern" ↓ Task Graph: ├── [parallel] │ ├── generate_3d("tavern building, stone walls") │ ├── generate_3d("wooden table, medieval style") │ └── generate_3d("wooden chair, medieval style") ×4 ├── [sequential, depends on above] │ ├── instantiate all generated models │ ├── arrange furniture (table center, chairs around) │ └── add candle props on table └── [parallel] ├── setup warm directional light └── add point lights for candle glow ``` -------------------------------- ### Project Audit Automation Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/USE_CASES.md Automates the process of identifying project errors, unused assets, and hierarchy issues. ```text You: "Review my project — any issues I should know about?" AI executes: 1. editor_get_console_errors → 23 warnings, 2 errors 2. asset_list("*.mat") → Find unused materials 3. scene_get_hierarchy → Check for orphaned objects 4. editor_get_project_settings → Check quality settings AI: "Found 3 issues: 1. 2 NullReferenceExceptions in PlayerController.cs (line 45, 78) 2. 7 materials are imported but never referenced 3. 12 empty GameObjects with no components (probably leftover from testing) Want me to clean up the empty GameObjects?" ``` -------------------------------- ### Return McpToolResult values in C# Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/CONTRIBUTING.md Use McpToolResult to return success messages or error details to the agent. ```csharp // Success — return human-readable text the agent can parse return McpToolResult.Success("Created 3 objects at positions (0,0,0), (1,0,0), (2,0,0)"); // Error — agent will see this and can retry or adjust return McpToolResult.Error("Material not found at path: Assets/Missing.mat"); ``` -------------------------------- ### Configure Required Field Validation Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/docs/ELICITATION_TEST_GUIDE.md Modify the mock agent schema to test required field validation by adding a string property without a default value. ```js properties: { ticketId: { type: 'string', title: 'Ticket ID' }, // …existing strategy/note… }, required: ['ticketId', 'strategy'], ``` -------------------------------- ### Define ToolPermissionLevel in C# Source: https://github.com/3dlabinstruments/unityacpclient/blob/main/CONTRIBUTING.md Override the PermissionLevel property for operations that modify the project or scene state. ```csharp // Override for dangerous operations (delete, build, play mode) public ToolPermissionLevel PermissionLevel => ToolPermissionLevel.Dangerous; // Default is ReadOnly — no override needed for read-only tools // Write is inferred from name patterns (set_, create_, modify_, etc.) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.