- Home /
Loading unknown amount of assets from folder
Is it possible to programatically go through all files in a folder (subfolder of assets-folder) and load all the images in the folder?
Answer by MartinCA · Dec 27, 2013 at 12:56 PM
If the files are pre-compiled into the resources pipeline, you can simply use Resources.LoadAll - do note that your files need to reside under Assets/Resources.
Answer by whydoidoit · Dec 27, 2013 at 12:54 PM
If you mean at run time then no you can't. Assets folders don't make it into the build that way and "Resources" folders are compressed into a single archive. So at runtime you need to maintain a list of what exists.
You could of course load things that you had managed to put into a folder on the device (Streaming Assets folder gets copied to the device for instance or you could just have downloaded stuff your self). In that case you can use the standard .NET methods such as
using System.IO;
var files = Directory.GetFiles("Somepath");
Your answer
![](https://koobas.hobune.stream/wayback/20220613124944im_/https://answers.unity.com/themes/thub/images/avi.jpg)