- Home /
How do you Load Resources from a Zip File?
string filePath = Path.Combine(resourcesPath, zipName);
using (FileStream memoryStream = new FileStream(filePath, FileMode.OpenOrCreate))
{
using (ZipArchive archive = new ZipArchive(memoryStream, ZipArchiveMode.Update))
{
using (StreamReader reader = new StreamReader(archive.GetEntry("\\BasicMaterials\\BasicMaterial_128_001.png").Open()))
{
Resources.Load<Sprite>(reader.);
}
}
}
Anyone know of a way to do this?
more so i'd like it to be a wild card like: using (StreamReader reader = new StreamReader(archive.GetEntry("\\Basic$$anonymous$$aterials\*").Open()))
Have you checked this? https://forum.unity.com/threads/extracting-zip-files.472537/
Extracting is not the same thing as loading resources into memory. That is a completely different thing and would put read/write onto an SSD over and over. Doing something like that would not be good practice. I'm able to read/write JSON files so it shouldn't be much harder to do the same with the other resources...
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Illuminating a 3D object's edges OnMouseOver (script in c#)? 1 Answer
Resources.load allways returns NULL but the Path seems to be correct 1 Answer
What does Unity actually do when Loading Resources that already exist? 0 Answers