- Home /
How to access sub-folders inside the Resources folder after build time?
I have a file structure like so:
/Assets/Resources/Thumbnails/
And because of how the file structure is changed once built I cannot access the sub-folder any more. I needed to count how many files that were in the sub-folder and I was using:
System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(Application.dataPath + "/Resources/Thumbnails/");
int count = dir.GetFiles().Length - 1;
And then I was loading the images later using:
(Texture)Resources.Load("Thumbnails/" + thumbnailName);
How could I go about finding the path to this folder again? I found someone who mentioned a manifest.txt that they loaded but gave no information more than that and I couldn't find any information on that possibility.
Answer by whydoidoit · Aug 23, 2013 at 02:15 PM
Well you would have to create your own manifest file as after the build there is no longer any meta information about the folders etc, in other words you cannot, post build access the list of files in the resources folders (or at least I've never found a way).
What I do is make a list of the files and folders using an editor tool and store it in a text file which I can then use to find things.
Your answer
Follow this Question
Related Questions
Loading a font via WWW 0 Answers
How to safely manage 100 large JPEGs in a picture viewer app 0 Answers
Loading texture resource runtime? 1 Answer
Is there a unified method for loading assets? 1 Answer
Problem accessing C# from Javascript 1 Answer