Skip to content

Commit 9dff8f1

Browse files
authored
Merge branch 'CoplayDev:main' into main
2 parents 83b9e47 + 4643802 commit 9dff8f1

File tree

71 files changed

+2627
-4146
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+2627
-4146
lines changed

MCPForUnity/Editor/Data/DefaultServerConfig.cs

Lines changed: 0 additions & 17 deletions
This file was deleted.

MCPForUnity/Editor/Dependencies/DependencyManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ private static void GenerateRecommendations(DependencyCheckResult result, IPlatf
126126
{
127127
if (dep.Name == "Python")
128128
{
129-
result.RecommendedActions.Add($"Install Python 3.10+ from: {detector.GetPythonInstallUrl()}");
129+
result.RecommendedActions.Add($"Install Python 3.11+ from: {detector.GetPythonInstallUrl()}");
130130
}
131131
else if (dep.Name == "UV Package Manager")
132132
{

MCPForUnity/Editor/Dependencies/PlatformDetectors/LinuxPlatformDetector.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public override DependencyStatus DetectPython()
6262
}
6363
}
6464

65-
status.ErrorMessage = "Python not found. Please install Python 3.10 or later.";
65+
status.ErrorMessage = "Python not found. Please install Python 3.11 or later.";
6666
status.Details = "Checked common installation paths including system, snap, and user-local locations.";
6767
}
6868
catch (Exception ex)
@@ -144,10 +144,10 @@ private bool TryValidatePython(string pythonPath, out string version, out string
144144
version = output.Substring(7); // Remove "Python " prefix
145145
fullPath = pythonPath;
146146

147-
// Validate minimum version (Python 4+ or Python 3.10+)
147+
// Validate minimum version (Python 4+ or Python 3.11+)
148148
if (TryParseVersion(version, out var major, out var minor))
149149
{
150-
return major > 3 || (major >= 3 && minor >= 10);
150+
return major > 3 || (major >= 3 && minor >= 11);
151151
}
152152
}
153153
}

MCPForUnity/Editor/Dependencies/PlatformDetectors/MacOSPlatformDetector.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ public override DependencyStatus DetectPython()
3535
"/opt/homebrew/bin/python3",
3636
"/Library/Frameworks/Python.framework/Versions/3.13/bin/python3",
3737
"/Library/Frameworks/Python.framework/Versions/3.12/bin/python3",
38-
"/Library/Frameworks/Python.framework/Versions/3.11/bin/python3",
39-
"/Library/Frameworks/Python.framework/Versions/3.10/bin/python3"
38+
"/Library/Frameworks/Python.framework/Versions/3.11/bin/python3"
4039
};
4140

4241
foreach (var candidate in candidates)
@@ -65,7 +64,7 @@ public override DependencyStatus DetectPython()
6564
}
6665
}
6766

68-
status.ErrorMessage = "Python not found. Please install Python 3.10 or later.";
67+
status.ErrorMessage = "Python not found. Please install Python 3.11 or later.";
6968
status.Details = "Checked common installation paths including Homebrew, Framework, and system locations.";
7069
}
7170
catch (Exception ex)
@@ -144,10 +143,10 @@ private bool TryValidatePython(string pythonPath, out string version, out string
144143
version = output.Substring(7); // Remove "Python " prefix
145144
fullPath = pythonPath;
146145

147-
// Validate minimum version (Python 4+ or Python 3.10+)
146+
// Validate minimum version (Python 4+ or Python 3.11+)
148147
if (TryParseVersion(version, out var major, out var minor))
149148
{
150-
return major > 3 || (major >= 3 && minor >= 10);
149+
return major > 3 || (major >= 3 && minor >= 11);
151150
}
152151
}
153152
}

MCPForUnity/Editor/Dependencies/PlatformDetectors/WindowsPlatformDetector.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public override DependencyStatus DetectPython()
6868
}
6969
}
7070

71-
status.ErrorMessage = "Python not found. Please install Python 3.10 or later.";
71+
status.ErrorMessage = "Python not found. Please install Python 3.11 or later.";
7272
status.Details = "Checked common installation paths and PATH environment variable.";
7373
}
7474
catch (Exception ex)
@@ -132,10 +132,10 @@ private bool TryValidatePython(string pythonPath, out string version, out string
132132
version = output.Substring(7); // Remove "Python " prefix
133133
fullPath = pythonPath;
134134

135-
// Validate minimum version (Python 4+ or Python 3.10+)
135+
// Validate minimum version (Python 4+ or Python 3.11+)
136136
if (TryParseVersion(version, out var major, out var minor))
137137
{
138-
return major > 3 || (major >= 3 && minor >= 10);
138+
return major > 3 || (major >= 3 && minor >= 11);
139139
}
140140
}
141141
}

MCPForUnity/Editor/Helpers/CodexConfigHelper.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.IO;
44
using System.Linq;
55
using MCPForUnity.External.Tommy;
6+
using MCPForUnity.Editor.Services;
67

78
namespace MCPForUnity.Editor.Helpers
89
{
@@ -26,10 +27,10 @@ public static bool IsCodexConfigured(string pythonDir)
2627
string toml = File.ReadAllText(configPath);
2728
if (!TryParseCodexServer(toml, out _, out var args)) return false;
2829

29-
string dir = McpConfigFileHelper.ExtractDirectoryArg(args);
30+
string dir = McpConfigurationHelper.ExtractDirectoryArg(args);
3031
if (string.IsNullOrEmpty(dir)) return false;
3132

32-
return McpConfigFileHelper.PathsEqual(dir, pythonDir);
33+
return McpConfigurationHelper.PathsEqual(dir, pythonDir);
3334
}
3435
catch
3536
{
@@ -125,6 +126,8 @@ private static TomlTable TryParseToml(string toml)
125126
/// <summary>
126127
/// Creates a TomlTable for the unityMCP server configuration
127128
/// </summary>
129+
/// <param name="uvPath">Path to uv executable</param>
130+
/// <param name="serverSrc">Path to server source directory</param>
128131
private static TomlTable CreateUnityMcpTable(string uvPath, string serverSrc)
129132
{
130133
var unityMCP = new TomlTable();
@@ -137,6 +140,15 @@ private static TomlTable CreateUnityMcpTable(string uvPath, string serverSrc)
137140
argsArray.Add(new TomlString { Value = "server.py" });
138141
unityMCP["args"] = argsArray;
139142

143+
// Add Windows-specific environment configuration, see: https://github.com/CoplayDev/unity-mcp/issues/315
144+
var platformService = MCPServiceLocator.Platform;
145+
if (platformService.IsWindows())
146+
{
147+
var envTable = new TomlTable { IsInline = true };
148+
envTable["SystemRoot"] = new TomlString { Value = platformService.GetSystemRoot() };
149+
unityMCP["env"] = envTable;
150+
}
151+
140152
return unityMCP;
141153
}
142154

MCPForUnity/Editor/Helpers/McpConfigFileHelper.cs

Lines changed: 0 additions & 186 deletions
This file was deleted.

0 commit comments

Comments
 (0)