Просмотр исходного кода

Fix missing asset detection on Windows, adding FileSystem::Exists which checks whether a file or directory exists at a path

JoshEngebretson 10 лет назад
Родитель
Сommit
4e2105b6f2
2 измененных файлов с 4 добавлено и 1 удалено
  1. 3 0
      Source/Atomic/IO/FileSystem.h
  2. 1 1
      Source/ToolCore/Assets/AssetDatabase.cpp

+ 3 - 0
Source/Atomic/IO/FileSystem.h

@@ -110,6 +110,9 @@ public:
     /// Copy a directory, directoryOut must not exist
     bool CopyDir(const String& directoryIn, const String& directoryOut);
 
+	/// Check if a file or directory exists at the specified path
+    bool Exists(const String& pathName) const { return FileExists(pathName) || DirExists(pathName); }
+
     bool CreateDirsRecursive(const String& directoryIn, const String& directoryOut);
     
 private:

+ 1 - 1
Source/ToolCore/Assets/AssetDatabase.cpp

@@ -441,7 +441,7 @@ void AssetDatabase::HandleFileChanged(StringHash eventType, VariantMap& eventDat
 
     if (asset)
     {
-        if(!fs->FileExists(fullPath))
+        if(!fs->Exists(fullPath))
         {
             DeleteAsset(asset);
         }