diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index c939924..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -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'] diff --git a/README-DEV.md b/README-DEV.md index 71f9679..98dafae 100644 --- a/README-DEV.md +++ b/README-DEV.md @@ -53,6 +53,7 @@ X:\UnityProject\Library\PackageCache\com.coplaydev.unity-mcp@ Example (hash): ``` X:\UnityProject\Library\PackageCache\com.coplaydev.unity-mcp@272123cfd97e + ``` To find it reliably: diff --git a/README.md b/README.md index ad19c09..673837b 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,7 @@ Connect your MCP Client (Claude, Cursor, etc.) to the Python server you installe 2. Click `Auto-Setup`. 3. Look for a green status indicator 🟢 and "Connected ✓". *(This attempts to modify the MCP Client\'s config file automatically)*. + **Option B: Manual Configuration** If Auto-Setup fails or you use a different client: diff --git a/UnityMcpBridge/Editor/Helpers/ServerInstaller.cs b/UnityMcpBridge/Editor/Helpers/ServerInstaller.cs index a5f0999..32a3070 100644 --- a/UnityMcpBridge/Editor/Helpers/ServerInstaller.cs +++ b/UnityMcpBridge/Editor/Helpers/ServerInstaller.cs @@ -10,6 +10,7 @@ namespace UnityMcpBridge.Editor.Helpers { private const string RootFolder = "UnityMCP"; private const string ServerFolder = "UnityMcpServer"; + /// /// Ensures the unity-mcp-server is installed locally by copying from the embedded package source. /// No network calls or Git operations are performed. @@ -135,45 +136,58 @@ namespace UnityMcpBridge.Editor.Helpers catch { /* ignore */ } // 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(); - while (!list.IsCompleted) { } - if (list.Status == UnityEditor.PackageManager.StatusCode.Success) + if (pkg.name == LegacyId) { - foreach (var pkg in list.Result) - { - if (pkg.name == "com.justinpbarnett.unity-mcp") - { - string packagePath = pkg.resolvedPath; // e.g., Library/PackageCache/... or local path + Debug.LogWarning( + "UnityMCP: Detected legacy package id 'com.justinpbarnett.unity-mcp'. " + + "Please update Packages/manifest.json to 'com.coplaydev.unity-mcp' to avoid future breakage." + ); + } - // Preferred: UnityMcpServer~ embedded alongside Editor/Runtime within the package (ignored by Unity import) - string embeddedTilde = Path.Combine(packagePath, "UnityMcpServer~", "src"); - if (Directory.Exists(embeddedTilde) && File.Exists(Path.Combine(embeddedTilde, "server.py"))) - { - srcPath = embeddedTilde; - return true; - } + string packagePath = pkg.resolvedPath; // e.g., Library/PackageCache/... or local path - // Fallback: legacy non-tilde folder name inside the package - string embedded = Path.Combine(packagePath, "UnityMcpServer", "src"); - if (Directory.Exists(embedded) && File.Exists(Path.Combine(embedded, "server.py"))) - { - srcPath = embedded; - return true; - } + // Preferred: tilde folder embedded alongside Editor/Runtime within the package + string embeddedTilde = Path.Combine(packagePath, "UnityMcpServer~", "src"); + if (Directory.Exists(embeddedTilde) && File.Exists(Path.Combine(embeddedTilde, "server.py"))) + { + srcPath = embeddedTilde; + 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; - } - } - } + // Fallback: legacy non-tilde folder name inside the package + string embedded = Path.Combine(packagePath, "UnityMcpServer", "src"); + if (Directory.Exists(embedded) && File.Exists(Path.Combine(embedded, "server.py"))) + { + srcPath = embedded; + 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 */ } // 3) Fallback to previous common install locations diff --git a/UnityMcpBridge/Editor/Windows/UnityMcpEditorWindow.cs b/UnityMcpBridge/Editor/Windows/UnityMcpEditorWindow.cs index 1f9cbcc..859ce15 100644 --- a/UnityMcpBridge/Editor/Windows/UnityMcpEditorWindow.cs +++ b/UnityMcpBridge/Editor/Windows/UnityMcpEditorWindow.cs @@ -996,7 +996,7 @@ namespace UnityMcpBridge.Editor.Windows { 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;