I’m having a lot of trouble figuring out how I am meant to use asset bundles so they don’t take gigabits of RAM.
I am downloading my bundles with:
UnityWebRequest request = UnityWebRequestAssetBundle.GetAssetBundle(url,version,0)
AssetBundle bundle = DownloadHandlerAssetBundle.GetContent(request);
Then saving that bundle to a variable in a singleton for access during runtime:
data_bundle = bundle;
Then, when I need the images for my cards in the bundle, I load them all into a dictionary from the bundle like so:
imageCache[imageName] = data_bundle .LoadAsset<Sprite>(imageName);
And then when a card needs an image take it from the imageCache.
This is obviously wrong, I did the same thing with the resource folder (Loading all images from resources to a cache which was used during runtime), and I am now using more than 4x the RAM. Why? - what is the correct method to use AssetBundles?