Prechádzať zdrojové kódy

Add the GetResourceDirs function into C# ResourceCache

weinand 8 rokov pred
rodič
commit
7a89cedb04

+ 15 - 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,20 @@ namespace AtomicEngine
             return null;
         }
 
+        public List<string> GetResourceDirs()
+        {
+            List<string> resourceDirs = new List<string>();
+
+            ResourceCache cache = AtomicNET.GetSubsystem<ResourceCache>();
+
+            for (uint i = 0; i < cache.GetNumResourceDirs(); i++)
+            {
+                resourceDirs.Add(cache.GetResourceDir(i));
+            }
+
+            return resourceDirs;
+        }
+
         /// <summary>
         ///  Release all resources. When called with the force flag false, releases all currently unused resources.
         /// </summary>