Browse Source

Auto create the Cache folder

Josh Engebretson 10 years ago
parent
commit
8dc83c2db1
1 changed files with 5 additions and 0 deletions
  1. 5 0
      Source/ToolCore/Assets/AssetDatabase.cpp

+ 5 - 0
Source/ToolCore/Assets/AssetDatabase.cpp

@@ -400,6 +400,11 @@ void AssetDatabase::HandleProjectLoaded(StringHash eventType, VariantMap& eventD
 {
     project_ = GetSubsystem<ToolSystem>()->GetProject();
 
+    FileSystem* fs = GetSubsystem<FileSystem>();
+
+    if (!fs->DirExists(GetCachePath()))
+        fs->CreateDir(GetCachePath());
+
     ResourceCache* cache = GetSubsystem<ResourceCache>();
     cache->AddResourceDir(GetCachePath());