Explorar o código

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

JoshEngebretson %!s(int64=10) %!d(string=hai) anos
pai
achega
4e2105b6f2
Modificáronse 2 ficheiros con 4 adicións e 1 borrados
  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);
         }