Kaynağa Gözat

Fixes for drag and drop import

Josh Engebretson 10 yıl önce
ebeveyn
işleme
e59d4d00d7

+ 4 - 2
Source/ToolCore/Assets/Asset.cpp

@@ -190,7 +190,8 @@ bool Asset::SetPath(const String& path)
     path_ = path;
 
     // create importer based on path
-    CreateImporter();
+    if (!CreateImporter())
+        return false;
 
     String assetFilename = GetDotAssetFilename();
 
@@ -201,6 +202,7 @@ bool Asset::SetPath(const String& path)
     }
     else
     {
+        dirty_ = true;
         guid_ = db->GenerateAssetGUID();
         timestamp_ = fs->GetLastModifiedTime(path);
 
@@ -209,7 +211,7 @@ bool Asset::SetPath(const String& path)
 
     // TODO: handle failed
 
-
+    return true;
 
 }
 

+ 3 - 2
Source/ToolCore/Assets/AssetDatabase.cpp

@@ -215,8 +215,9 @@ void AssetDatabase::Scan()
         {
             // new asset
             SharedPtr<Asset> asset(new Asset(context_));
-            asset->SetPath(path);
-            AddAsset(asset);
+
+            if (asset->SetPath(path))
+                AddAsset(asset);
         }
         else
         {