Skip to content

Commit 241118d

Browse files
authored
[Feature] manage_camera with cinemachine support (CoplayDev#882)
* Initial commit * Fix and GUI update * Updates and bug fix * Doc update * Update CameraCreate.cs
1 parent 1d623ec commit 241118d

28 files changed

Lines changed: 2986 additions & 150 deletions
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using MCPForUnity.Editor.Helpers;
5+
using MCPForUnity.Editor.Tools.Cameras;
6+
using Newtonsoft.Json.Linq;
7+
using UnityEngine;
8+
9+
namespace MCPForUnity.Editor.Resources.Scene
10+
{
11+
[McpForUnityResource("get_cameras")]
12+
public static class CamerasResource
13+
{
14+
public static object HandleCommand(JObject @params)
15+
{
16+
try
17+
{
18+
return CameraControl.ListCameras(@params ?? new JObject());
19+
}
20+
catch (Exception e)
21+
{
22+
McpLog.Error($"[CamerasResource] Error listing cameras: {e}");
23+
return new ErrorResponse($"Error listing cameras: {e.Message}");
24+
}
25+
}
26+
}
27+
}

MCPForUnity/Editor/Resources/Scene/CamerasResource.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

MCPForUnity/Editor/Tools/Cameras.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)