Force proper extension if manually specified by user during asset creation

This commit is contained in:
Lukáš Jech
2020-12-21 03:58:52 +01:00
parent f35c666ea8
commit 07f58558e3

View File

@@ -318,7 +318,7 @@ namespace FlaxEditor.Windows
// Cache data
var extension = Path.GetExtension(item.Path);
var newPath = StringUtils.CombinePaths(item.ParentFolder.Path, newShortName + extension);
var newPath = StringUtils.CombinePaths(item.ParentFolder.Path, Path.ChangeExtension(newShortName, extension));
// Check if was renaming mock element
// Note: we create `_newElement` and then rename it to create new asset