updated config path locator
parent
4144af2453
commit
20aa6839fe
|
|
@ -50,7 +50,10 @@ public static partial class UnityMCPBridge
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string configPath = Path.Combine(Application.dataPath, "MCPServer", "config.json");
|
// Get the directory of the current script
|
||||||
|
string scriptPath = Path.GetDirectoryName(typeof(UnityMCPBridge).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);
|
||||||
|
|
@ -59,7 +62,7 @@ public static partial class UnityMCPBridge
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.LogError("Server config file not found!");
|
Debug.LogError($"Server config file not found at: {configPath}");
|
||||||
serverConfig = new DefaultServerConfig();
|
serverConfig = new DefaultServerConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue