Loading data at runtime (Asset Bundles)

If I have an asset bundle stored locally on disk, Is there a way to load an individual asset from it rather than having to load the entire asset bundle first?

For example, say I have 15 prefabs stored inside an asset bundle which totals around 150mb, is there a way to cherry pick what is loaded into memory? Or am I forced to diversify the bundle into smaller files to avoid issues?

I’m finding that running the loadfromfile causes the application to block for around 20 seconds (Loading synchronously is required).

Actually this is really the primary use case of asset bundles. The only thing loaded is the manifest necessary to know how to index the bundle resources. You can then pull out resources individually. I use fairly massive asset bundles and there is never any significant delay. I load all my prefabs and sounds synchronously on-demand from asset bundles as the game runs and my resource manager requests them. Eventually I will implement some sort of staling heuristic that will unload them to keep memory somewhat stable.

This is also probably not the right forum for this question as this forum tends not to focus on technical issues.

1 Like