Fix importing and using files without extension in Editor content

This commit is contained in:
2026-04-08 20:36:02 +02:00
parent 21decf6790
commit 5b922e069e
2 changed files with 8 additions and 5 deletions
@@ -106,11 +106,14 @@ namespace FlaxEditor.Content.Import
{
// Get extension (without a dot)
var extension = Path.GetExtension(request.InputPath);
if (string.IsNullOrEmpty(extension))
if (File.GetAttributes(request.InputPath).HasFlag(FileAttributes.Directory))
return new FolderImportEntry(ref request);
if (extension[0] == '.')
extension = extension.Remove(0, 1);
extension = extension.ToLower();
if (extension.Length > 0)
{
if (extension[0] == '.')
extension = extension.Remove(0, 1);
extension = extension.ToLower();
}
// Check if use overriden type
if (FileTypes.TryGetValue(extension, out ImportFileEntryHandler createDelegate))
@@ -161,7 +161,7 @@ namespace FlaxEditor.Modules
public ContentProxy GetProxy(string extension)
{
if (string.IsNullOrEmpty(extension))
throw new ArgumentNullException();
return null;
extension = StringUtils.NormalizeExtension(extension);
for (int i = 0; i < Proxy.Count; i++)
{