Browse Source

Merge pull request #1494 from LumaDigital/WVV-GetResourceDirs

Add the GetResourceDirs function into C# ResourceCache
JoshEngebretson 8 years ago
parent
commit
9476062b92
1 changed files with 18 additions and 0 deletions
  1. 18 0
      Script/AtomicNET/AtomicNET/Resource/ResourceCache.cs

+ 18 - 0
Script/AtomicNET/AtomicNET/Resource/ResourceCache.cs

@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;
 using System.Runtime.InteropServices;
 
 namespace AtomicEngine
@@ -29,6 +30,23 @@ namespace AtomicEngine
             return null;
         }
 
+        /// <summary>
+        ///  Gets all resource directories and places it within an array.
+        /// </summary>
+        public string[] GetResourceDirs()
+        {
+            ResourceCache cache = GetSubsystem<ResourceCache>();
+
+             string[] resourceDirs = new string[cache.GetNumResourceDirs()];
+
+            for (uint i = 0; i < cache.GetNumResourceDirs(); i++)
+            {
+                resourceDirs[i] = cache.GetResourceDir(i);
+            }
+
+            return resourceDirs;
+        }
+
         /// <summary>
         ///  Release all resources. When called with the force flag false, releases all currently unused resources.
         /// </summary>