We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 784ecd4 commit eef4261Copy full SHA for eef4261
MCPForUnity/Editor/Tools/ManageMaterial.cs
@@ -57,8 +57,16 @@ public static object HandleCommand(JObject @params)
57
private static string NormalizePath(string path)
58
{
59
if (string.IsNullOrEmpty(path)) return path;
60
- if (!path.StartsWith("Assets/")) path = "Assets/" + path;
61
- if (!path.EndsWith(".mat", StringComparison.OrdinalIgnoreCase)) path += ".mat";
+
+ // Normalize separators and ensure Assets/ root
62
+ path = AssetPathUtility.SanitizeAssetPath(path);
63
64
+ // Ensure .mat extension
65
+ if (!path.EndsWith(".mat", StringComparison.OrdinalIgnoreCase))
66
+ {
67
+ path += ".mat";
68
+ }
69
70
return path;
71
}
72
0 commit comments