Fix importing and using files without extension in Editor content
This commit is contained in:
@@ -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++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user