Skip to content

Commit ad4b08a

Browse files
committed
Update path to read from existing settings file.
1 parent 876acb9 commit ad4b08a

File tree

4 files changed

+7
-25
lines changed

4 files changed

+7
-25
lines changed

Editor/UnityBridge/McpUnitySettings.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ public class McpUnitySettings
1919

2020
private const string EnvUnityPort = "UNITY_PORT";
2121
private const string EnvUnityRequestTimeout = "UNITY_REQUEST_TIMEOUT";
22+
/// <remarks>
23+
/// This file path is also read by the MCP server. Changes here will require updates to it. See mcpUnity.ts
24+
/// </remarks>
2225
private const string SettingsPath = "ProjectSettings/McpUnitySettings.json";
2326

2427
private static McpUnitySettings _instance;
@@ -83,17 +86,16 @@ public void LoadSettings()
8386
/// <summary>
8487
/// Save settings to disk
8588
/// </summary>
89+
/// <remarks>
90+
/// WARNING: This file is also read by the MCP server. Changes here will require updates to it. See mcpUnity.ts
91+
/// </remarks>
8692
public void SaveSettings()
8793
{
8894
try
8995
{
9096
// Save settings to McpUnitySettings.json
9197
string json = JsonUtility.ToJson(this, true);
9298
File.WriteAllText(SettingsPath, json);
93-
94-
// Now save these same settings to the server to read on start-up.
95-
string propertiesPath = GetServerPath() + "/build/McpUnitySettings.json";
96-
File.WriteAllText(propertiesPath, json);
9799
}
98100
catch (Exception ex)
99101
{

README.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -383,20 +383,6 @@ This error occurs because the bridge connection is lost when the domain reloads
383383
The workaround is to turn off **Reload Domain** in **Edit > Project Settings > Editor > "Enter Play Mode Settings"**.
384384
</details>
385385

386-
## Node Server
387-
These steps can be useful if you want to build and run the server independently of the Unity plugin.
388-
### Requirements
389-
As well as `node`, you will need `tsc`.
390-
### Steps
391-
1. cd into the `Server~/` directory.
392-
2. run `npm install` to install the project.
393-
3. run `npm run build` to build the project.
394-
4. run `node build/index.js` to run the server! 🚀
395-
396-
### Troubleshooting 🔨
397-
#### Logging
398-
Logging is enabled when the environment variable `LOGGING` is set to true. E.g. `export LOGGING=true`.
399-
400386
## Support & Feedback
401387

402388
If you have any questions or need support, please open an [issue](https://github.com/CoderGamester/mcp-unity/issues) on this repository.

Server~/build/McpUnitySettings.json

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

Server~/src/unity/mcpUnity.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ export class McpUnity {
293293
* @returns a JSON object with the contents of the McpUnitySettings.json file.
294294
*/
295295
private async readConfigFileAsJson(): Promise<any> {
296-
const configPath = path.resolve(process.cwd(), 'build/McpUnitySettings.json');
296+
const configPath = path.resolve(process.cwd(), '../ProjectSettings/McpUnitySettings.json');
297297
this.logger.debug(`Reading McpUnitySettings.json from ${configPath}`);
298298
try {
299299
const content = await fs.readFile(configPath, 'utf-8');

0 commit comments

Comments
 (0)