Various improvements for Editor

This commit is contained in:
Wojtek Figat
2022-05-06 17:14:25 +02:00
parent 3766488114
commit 90906baae2
7 changed files with 49 additions and 36 deletions

View File

@@ -897,5 +897,19 @@ namespace FlaxEditor.Utilities
};
return menu;
}
/// <summary>
/// Gets the asset name relative to the project root folder (without asset file extension)
/// </summary>
/// <param name="path">The asset path.</param>
/// <returns>The processed name path.</returns>
public static string GetAssetNamePath(string path)
{
if (path.StartsWith(Globals.ProjectFolder))
{
path = path.Substring(Globals.ProjectFolder.Length + 1);
}
return StringUtils.GetPathWithoutExtension(path);
}
}
}