升级XR插件版本

This commit is contained in:
Sora丶kong
2026-03-02 17:56:21 +08:00
parent 8962657674
commit 60f512a9bc
1317 changed files with 110305 additions and 48249 deletions

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using MCPForUnity.Editor.Helpers;
using Newtonsoft.Json.Linq;
using UnityEngine;
namespace MCPForUnity.Editor.Resources.Project
{
/// <summary>
/// Provides dictionary of layer indices to layer names.
/// </summary>
[McpForUnityResource("get_layers")]
public static class Layers
{
private const int TotalLayerCount = 32;
public static object HandleCommand(JObject @params)
{
try
{
var layers = new Dictionary<int, string>();
for (int i = 0; i < TotalLayerCount; i++)
{
string layerName = LayerMask.LayerToName(i);
if (!string.IsNullOrEmpty(layerName))
{
layers.Add(i, layerName);
}
}
return new SuccessResponse("Retrieved current named layers.", layers);
}
catch (Exception e)
{
return new ErrorResponse($"Failed to retrieve layers: {e.Message}");
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 959ee428299454ac19a636275208ca00
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,41 @@
using System;
using System.IO;
using MCPForUnity.Editor.Helpers;
using Newtonsoft.Json.Linq;
using UnityEditor;
using UnityEngine;
namespace MCPForUnity.Editor.Resources.Project
{
/// <summary>
/// Provides static project configuration information.
/// </summary>
[McpForUnityResource("get_project_info")]
public static class ProjectInfo
{
public static object HandleCommand(JObject @params)
{
try
{
string assetsPath = Application.dataPath.Replace('\\', '/');
string projectRoot = Directory.GetParent(assetsPath)?.FullName.Replace('\\', '/');
string projectName = Path.GetFileName(projectRoot);
var info = new
{
projectRoot = projectRoot ?? "",
projectName = projectName ?? "",
unityVersion = Application.unityVersion,
platform = EditorUserBuildSettings.activeBuildTarget.ToString(),
assetsPath = assetsPath
};
return new SuccessResponse("Retrieved project info.", info);
}
catch (Exception e)
{
return new ErrorResponse($"Error getting project info: {e.Message}");
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 81b03415fcf93466e9ed667d19b58d43
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,27 @@
using System;
using MCPForUnity.Editor.Helpers;
using Newtonsoft.Json.Linq;
using UnityEditorInternal;
namespace MCPForUnity.Editor.Resources.Project
{
/// <summary>
/// Provides list of all tags in the project.
/// </summary>
[McpForUnityResource("get_tags")]
public static class Tags
{
public static object HandleCommand(JObject @params)
{
try
{
string[] tags = InternalEditorUtility.tags;
return new SuccessResponse("Retrieved current tags.", tags);
}
catch (Exception e)
{
return new ErrorResponse($"Failed to retrieve tags: {e.Message}");
}
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2179ac5d98f264d1681e7d5c0d0ed341
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: