Fix removing large amount of assets in Editor at once

#1484
This commit is contained in:
Wojtek Figat
2023-10-13 15:43:11 +02:00
parent cf94cd937a
commit abd6881d7b
3 changed files with 12 additions and 18 deletions

View File

@@ -629,8 +629,9 @@ namespace FlaxEditor.Windows
if (items.Count == 0)
return;
// TODO: remove items that depend on different items in the list: use wants to remove `folderA` and `folderA/asset.x`, we should just remove `folderA`
// Sort items to remove files first, then folders
var toDelete = new List<ContentItem>(items);
toDelete.Sort((a, b) => a.IsFolder ? 1 : -1);
string msg = toDelete.Count == 1
? string.Format("Are you sure to delete \'{0}\'?\nThis action cannot be undone. Files will be deleted permanently.", items[0].Path)