Merge remote-tracking branch 'origin/master' into 1.6

This commit is contained in:
Wojtek Figat
2023-05-10 12:13:45 +02:00
12 changed files with 105 additions and 58 deletions

View File

@@ -1081,7 +1081,7 @@ namespace FlaxEditor.Utilities
}
/// <summary>
/// Updates (recursivly) search popup tree structures based on the filter text.
/// Updates (recursively) search popup tree structures based on the filter text.
/// </summary>
public static void UpdateSearchPopupFilter(TreeNode node, string filterText)
{
@@ -1107,6 +1107,19 @@ namespace FlaxEditor.Utilities
node.Visible = isThisVisible | isAnyChildVisible;
}
/// <summary>
/// Gets the asset name relative to the project root folder (with asset file extension)
/// </summary>
/// <param name="path">The asset path.</param>
/// <returns>The processed name path.</returns>
public static string GetAssetNamePathWithExt(string path)
{
var projectFolder = Globals.ProjectFolder;
if (path.StartsWith(projectFolder))
path = path.Substring(projectFolder.Length + 1);
return path;
}
/// <summary>
/// Gets the asset name relative to the project root folder (without asset file extension)
/// </summary>
@@ -1114,9 +1127,7 @@ namespace FlaxEditor.Utilities
/// <returns>The processed name path.</returns>
public static string GetAssetNamePath(string path)
{
var projectFolder = Globals.ProjectFolder;
if (path.StartsWith(projectFolder))
path = path.Substring(projectFolder.Length + 1);
path = GetAssetNamePathWithExt(path);
return StringUtils.GetPathWithoutExtension(path);
}