I am working on a game where I have an asset bundle for each level. The idea is that these will be downloaded and saved to disk the first time the user plays a level. These asset bundles contain a number of scenes, and are about 50MB in size if compressed and about 350MB in size in uncompressed form.
From what I have read so far it looks like I have two options on how to load these asset bundles.
Option 1: Compressed form.
In this option I download the asset bundle to disk in its compressed form. Then, when I want to use it I do:
m_file = new WWW(@"file://<path to file>");
m_assetBundle = file.assetBundle;
Then I load my scenes as I need them
Application.LoadLevel("Scene1");
...
Application.LoadLevel("Scene2");
When I return to the main menu I do:
m_assetBundle.Unload(false);
m_file.Destroy
The problem with this method is that my 50MB asset bundle needs to be in RAM the whole time, which is a pretty big overhead.
Option 2: Uncompressed form
In this option I have created my asset bundle in uncompressed form (350MB) and have downloaded it to the disk.
When using I do:
m_assetBundle = AssetBundle.CreateFromFile("<path to file>");
Then I load my scenes as I need them
Application.LoadLevel("Scene1");
...
Application.LoadLevel("Scene2");
When I return to the main menu I do:
m_assetBundle.Unload(false);
This option gives much better memory usage (there is no 50MB overhead) but the user has to download a 350MB asset bundle.
Question
Is there a way to combine the best of these two options? Can I download my asset bundle in compressed form (50MB), uncompress it, and save it to disk in the uncompressed form (350MB). Then I can use the asset bundle directly from disk by using AssetBundle.CreateFromFile().
Many thanks