Merge branch 'main' into feat/bridge-stability
commit
b179ce1ed8
|
|
@ -1,15 +0,0 @@
|
||||||
# These are supported funding model platforms
|
|
||||||
|
|
||||||
github: justinpbarnett # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
|
||||||
patreon: # Replace with a single Patreon username
|
|
||||||
open_collective: # Replace with a single Open Collective username
|
|
||||||
ko_fi: # Replace with a single Ko-fi username
|
|
||||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
|
||||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
|
||||||
liberapay: # Replace with a single Liberapay username
|
|
||||||
issuehunt: # Replace with a single IssueHunt username
|
|
||||||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
|
||||||
polar: # Replace with a single Polar username
|
|
||||||
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
|
|
||||||
thanks_dev: # Replace with a single thanks.dev username
|
|
||||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
|
||||||
|
|
@ -53,6 +53,7 @@ X:\UnityProject\Library\PackageCache\com.coplaydev.unity-mcp@<version-or-hash>
|
||||||
Example (hash):
|
Example (hash):
|
||||||
```
|
```
|
||||||
X:\UnityProject\Library\PackageCache\com.coplaydev.unity-mcp@272123cfd97e
|
X:\UnityProject\Library\PackageCache\com.coplaydev.unity-mcp@272123cfd97e
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
To find it reliably:
|
To find it reliably:
|
||||||
|
|
|
||||||
|
|
@ -126,6 +126,7 @@ Connect your MCP Client (Claude, Cursor, etc.) to the Python server you installe
|
||||||
2. Click `Auto-Setup`.
|
2. Click `Auto-Setup`.
|
||||||
3. Look for a green status indicator 🟢 and "Connected ✓". *(This attempts to modify the MCP Client\'s config file automatically)*.
|
3. Look for a green status indicator 🟢 and "Connected ✓". *(This attempts to modify the MCP Client\'s config file automatically)*.
|
||||||
|
|
||||||
|
|
||||||
**Option B: Manual Configuration**
|
**Option B: Manual Configuration**
|
||||||
|
|
||||||
If Auto-Setup fails or you use a different client:
|
If Auto-Setup fails or you use a different client:
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ namespace UnityMcpBridge.Editor.Helpers
|
||||||
{
|
{
|
||||||
private const string RootFolder = "UnityMCP";
|
private const string RootFolder = "UnityMCP";
|
||||||
private const string ServerFolder = "UnityMcpServer";
|
private const string ServerFolder = "UnityMcpServer";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Ensures the unity-mcp-server is installed locally by copying from the embedded package source.
|
/// Ensures the unity-mcp-server is installed locally by copying from the embedded package source.
|
||||||
/// No network calls or Git operations are performed.
|
/// No network calls or Git operations are performed.
|
||||||
|
|
@ -135,45 +136,58 @@ namespace UnityMcpBridge.Editor.Helpers
|
||||||
catch { /* ignore */ }
|
catch { /* ignore */ }
|
||||||
|
|
||||||
// 2) Installed package: resolve via Package Manager
|
// 2) Installed package: resolve via Package Manager
|
||||||
try
|
// 2) Installed package: resolve via Package Manager (support new + legacy IDs, warn on legacy)
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var list = UnityEditor.PackageManager.Client.List();
|
||||||
|
while (!list.IsCompleted) { }
|
||||||
|
if (list.Status == UnityEditor.PackageManager.StatusCode.Success)
|
||||||
|
{
|
||||||
|
const string CurrentId = "com.coplaydev.unity-mcp";
|
||||||
|
const string LegacyId = "com.justinpbarnett.unity-mcp";
|
||||||
|
|
||||||
|
foreach (var pkg in list.Result)
|
||||||
|
{
|
||||||
|
if (pkg.name == CurrentId || pkg.name == LegacyId)
|
||||||
{
|
{
|
||||||
var list = UnityEditor.PackageManager.Client.List();
|
if (pkg.name == LegacyId)
|
||||||
while (!list.IsCompleted) { }
|
|
||||||
if (list.Status == UnityEditor.PackageManager.StatusCode.Success)
|
|
||||||
{
|
{
|
||||||
foreach (var pkg in list.Result)
|
Debug.LogWarning(
|
||||||
{
|
"UnityMCP: Detected legacy package id 'com.justinpbarnett.unity-mcp'. " +
|
||||||
if (pkg.name == "com.justinpbarnett.unity-mcp")
|
"Please update Packages/manifest.json to 'com.coplaydev.unity-mcp' to avoid future breakage."
|
||||||
{
|
);
|
||||||
string packagePath = pkg.resolvedPath; // e.g., Library/PackageCache/... or local path
|
}
|
||||||
|
|
||||||
// Preferred: UnityMcpServer~ embedded alongside Editor/Runtime within the package (ignored by Unity import)
|
string packagePath = pkg.resolvedPath; // e.g., Library/PackageCache/... or local path
|
||||||
string embeddedTilde = Path.Combine(packagePath, "UnityMcpServer~", "src");
|
|
||||||
if (Directory.Exists(embeddedTilde) && File.Exists(Path.Combine(embeddedTilde, "server.py")))
|
|
||||||
{
|
|
||||||
srcPath = embeddedTilde;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fallback: legacy non-tilde folder name inside the package
|
// Preferred: tilde folder embedded alongside Editor/Runtime within the package
|
||||||
string embedded = Path.Combine(packagePath, "UnityMcpServer", "src");
|
string embeddedTilde = Path.Combine(packagePath, "UnityMcpServer~", "src");
|
||||||
if (Directory.Exists(embedded) && File.Exists(Path.Combine(embedded, "server.py")))
|
if (Directory.Exists(embeddedTilde) && File.Exists(Path.Combine(embeddedTilde, "server.py")))
|
||||||
{
|
{
|
||||||
srcPath = embedded;
|
srcPath = embeddedTilde;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Legacy: sibling of the package folder (dev-linked). Only valid when present on disk.
|
// Fallback: legacy non-tilde folder name inside the package
|
||||||
string sibling = Path.Combine(Path.GetDirectoryName(packagePath) ?? string.Empty, "UnityMcpServer", "src");
|
string embedded = Path.Combine(packagePath, "UnityMcpServer", "src");
|
||||||
if (Directory.Exists(sibling) && File.Exists(Path.Combine(sibling, "server.py")))
|
if (Directory.Exists(embedded) && File.Exists(Path.Combine(embedded, "server.py")))
|
||||||
{
|
{
|
||||||
srcPath = sibling;
|
srcPath = embedded;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
// Legacy: sibling of the package folder (dev-linked). Only valid when present on disk.
|
||||||
|
string sibling = Path.Combine(Path.GetDirectoryName(packagePath) ?? string.Empty, "UnityMcpServer", "src");
|
||||||
|
if (Directory.Exists(sibling) && File.Exists(Path.Combine(sibling, "server.py")))
|
||||||
|
{
|
||||||
|
srcPath = sibling;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
catch { /* ignore */ }
|
catch { /* ignore */ }
|
||||||
|
|
||||||
// 3) Fallback to previous common install locations
|
// 3) Fallback to previous common install locations
|
||||||
|
|
|
||||||
|
|
@ -996,7 +996,7 @@ namespace UnityMcpBridge.Editor.Windows
|
||||||
{
|
{
|
||||||
foreach (UnityEditor.PackageManager.PackageInfo package in request.Result)
|
foreach (UnityEditor.PackageManager.PackageInfo package in request.Result)
|
||||||
{
|
{
|
||||||
if (package.name == "com.justinpbarnett.unity-mcp")
|
if (package.name == "com.coplaydev.unity-mcp")
|
||||||
{
|
{
|
||||||
string packagePath = package.resolvedPath;
|
string packagePath = package.resolvedPath;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue