Hi,
I’m creating a AssetBundleCreateRequest using AssetBundle.LoadFromMemoryAsync(path);
This is to load the music for the current part of the map. However, there is a chance that the user may go to another part of the map, or die, before the assetbundle is fully loaded. In which case, is there a way to cancel the load request? Or somehow just tell it to destroy itself when it’s ready?
Or should I be keeping hold of the AssetBundleCreateRequest and then destroying it if it’s no longer needed?
Thank you!
It does not seem to have anything to do that:
The parent object doesn’t either:
That said, I think if you just forget about it nothing bad will happen, and I imagine as soon as it is eligible for garbage collection, it’s all gone. I seem to recall it only uses a little bit of actual RAM to load an AssetBundle. It is only once you start pulling things out of the AssetBundle that real memory starts being used.
1 Like
Im trying to cancel the AssetBundle.LoadFileAsync request and thats working fine, but if i then try to load the same bundle it says its already loaded, but if I try to unload the bundle that loaded before cancelling the request it freezes unity