updated config location search in another place

main
Justin Barnett 2025-03-18 13:11:29 -04:00
parent a3493a49d9
commit ec79442fd4
1 changed files with 5 additions and 2 deletions

View File

@ -110,7 +110,10 @@ public class MCPEditorWindow : EditorWindow
{ {
try try
{ {
string configPath = Path.Combine(Application.dataPath, "MCPServer", "config.json"); // Get the directory of the current script
string scriptPath = Path.GetDirectoryName(typeof(MCPEditorWindow).Assembly.Location);
string configPath = Path.Combine(scriptPath, "..", "config.json");
if (File.Exists(configPath)) if (File.Exists(configPath))
{ {
string jsonConfig = File.ReadAllText(configPath); string jsonConfig = File.ReadAllText(configPath);
@ -119,7 +122,7 @@ public class MCPEditorWindow : EditorWindow
} }
else else
{ {
UnityEngine.Debug.LogError("Server config file not found!"); UnityEngine.Debug.LogError($"Server config file not found at: {configPath}");
serverConfig = new DefaultServerConfig(); serverConfig = new DefaultServerConfig();
} }
} }