updated config location search in another place
parent
a3493a49d9
commit
ec79442fd4
|
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue