How to iterate through resources?

Blackbeard

13-08-2008 19:17:27

Hi, maybe a classic question.

I want to get a list of my resources but dont know anymore how it works.

Finding Resource Groups isnt a problem:

ResourceGroupManager.ResourceManagerIterator it = ResourceGroupManager.Singleton.GetResourceManagerIterator();

while (it.MoveNext()) {string t = it.CurrentKey...add string t to list..}

But how to iterate through the resources within a group? For example to get all meshes within resource group "Mesh"?

ProfesorX

13-08-2008 20:10:20

I'm not sure if is this wat you want:


public List<string> FindFilesInGroup(string group, string pattern)
{
List<string> files = new List<string>();
FileInfoListPtr list = ResourceGroupManager.Singleton.FindResourceFileInfo(group, pattern);
foreach (FileInfo_NativePtr file in list)
{
files.Add(file.archive.Name + "/" + file.filename);
}
return files;
}

Blackbeard

13-08-2008 23:50:13

Great, exactly what i asked for!
Thank you:)