using System;
namespace MCPForUnity.Editor.Helpers
{
///
/// Provides common utility methods for working with Unity asset paths.
///
public static class AssetPathUtility
{
///
/// Normalizes a Unity asset path by ensuring forward slashes are used and that it is rooted under "Assets/".
///
public static string SanitizeAssetPath(string path)
{
if (string.IsNullOrEmpty(path))
{
return path;
}
path = path.Replace('\\', '/');
if (!path.StartsWith("Assets/", StringComparison.OrdinalIgnoreCase))
{
return "Assets/" + path.TrimStart('/');
}
return path;
}
}
}