Request API change or additional method if necessary:
AssetBundle.LoadFromFile|Async(string file, int crc, long offset, long size)
Reason:
In testing of this function (and the Async variant) the offset seems minimally useful.
I have a situation where I have multiple Assetbundles packed into a bigger pack file.
I tried to use this api to directly read out the assetbundle chunk in the file. The only time this works is, if the asset bundle is at the end of the file.
My guess would be that the function just reads the whole file after the offfset and tries to process it, which then locks up unity and the player pretty reliably.
Given this function is almost useful could we get a 'size' parameter added to this, then the underlying code wouldn't read past 'size' and then process the bundle?
As a work around right now I'm copying the bundle chunk out to a temp folder and then using that. I'd rather not do this as certain targets may have issues with the method.
Another workaround is to read the chunk in memory and then use the in memory methods, but this leads to lots of memory bloat in the C# and C++ side of the engine, also causing crashes.
AssetBundle.LoadFromFile|Async(string file, int crc, long offset, long size)
Would pretty helpful if I could get access to this.
↧