Skip to content

Commit c3e9a49

Browse files
Merge pull request #19 from justinpbarnett/feature/cursor-config
added cursor auto config
2 parents 03c12d0 + d7160f1 commit c3e9a49

37 files changed

+1962
-1573
lines changed

Editor/Commands/AssetCommandHandler.cs

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
using UnityEditor;
33
using System.IO;
44
using Newtonsoft.Json.Linq;
5-
using System.Linq;
65
using System.Collections.Generic;
76

8-
namespace MCPServer.Editor.Commands
7+
namespace UnityMCP.Editor.Commands
98
{
109
/// <summary>
1110
/// Handles asset-related commands for the MCP Server
@@ -51,10 +50,11 @@ public static object ImportAsset(JObject @params)
5150
}
5251
catch (System.Exception e)
5352
{
54-
return new {
55-
success = false,
56-
error = $"Failed to import asset: {e.Message}",
57-
stackTrace = e.StackTrace
53+
return new
54+
{
55+
success = false,
56+
error = $"Failed to import asset: {e.Message}",
57+
stackTrace = e.StackTrace
5858
};
5959
}
6060
}
@@ -67,16 +67,16 @@ public static object InstantiatePrefab(JObject @params)
6767
try
6868
{
6969
string prefabPath = (string)@params["prefab_path"];
70-
70+
7171
if (string.IsNullOrEmpty(prefabPath))
7272
return new { success = false, error = "Prefab path cannot be empty" };
7373

74-
Vector3 position = new Vector3(
74+
Vector3 position = new(
7575
(float)@params["position_x"],
7676
(float)@params["position_y"],
7777
(float)@params["position_z"]
7878
);
79-
Vector3 rotation = new Vector3(
79+
Vector3 rotation = new(
8080
(float)@params["rotation_x"],
8181
(float)@params["rotation_y"],
8282
(float)@params["rotation_z"]
@@ -93,7 +93,7 @@ public static object InstantiatePrefab(JObject @params)
9393
{
9494
return new { success = false, error = $"Failed to instantiate prefab: {prefabPath}" };
9595
}
96-
96+
9797
instance.transform.position = position;
9898
instance.transform.rotation = Quaternion.Euler(rotation);
9999

@@ -106,10 +106,11 @@ public static object InstantiatePrefab(JObject @params)
106106
}
107107
catch (System.Exception e)
108108
{
109-
return new {
110-
success = false,
111-
error = $"Failed to instantiate prefab: {e.Message}",
112-
stackTrace = e.StackTrace
109+
return new
110+
{
111+
success = false,
112+
error = $"Failed to instantiate prefab: {e.Message}",
113+
stackTrace = e.StackTrace
113114
};
114115
}
115116
}
@@ -162,9 +163,10 @@ public static object CreatePrefab(JObject @params)
162163
}
163164
catch (System.Exception e)
164165
{
165-
return new {
166-
success = false,
167-
error = $"Failed to create prefab: {e.Message}",
166+
return new
167+
{
168+
success = false,
169+
error = $"Failed to create prefab: {e.Message}",
168170
stackTrace = e.StackTrace,
169171
sourceInfo = $"Object: {@params["object_name"]}, Path: {@params["prefab_path"]}"
170172
};
@@ -218,9 +220,9 @@ public static object GetAssetList(JObject @params)
218220
assets.Add(new
219221
{
220222
name = Path.GetFileNameWithoutExtension(path),
221-
path = path,
223+
path,
222224
type = assetType?.Name ?? "Unknown",
223-
guid = guid
225+
guid
224226
});
225227
}
226228

Editor/Commands/CommandRegistry.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Collections.Generic;
33
using Newtonsoft.Json.Linq;
44

5-
namespace MCPServer.Editor.Commands
5+
namespace UnityMCP.Editor.Commands
66
{
77
/// <summary>
88
/// Registry for all MCP command handlers

0 commit comments

Comments
 (0)