Hi, I'm been trying to experiment with DumbGameDev's "Asset Bundle Unity Web Request" to try to cache the download to disk. Currently it does not cache the AssetBundle to disk because it uses DownloadHandlerAssetBundle which is a "Standard constructor for non-cached asset bundles." Therefore, it needs to be re-downloaded every time and I need it to be cached.
I currently use "WWWAssetBundle" created by the PlayMaker team and "AssetBundle Load From Cache or Download" by DumbGameDev and they both work pretty much the same. However, they both use WWW which is an insecure method and not allowed by iOS. Both actions work the way I need it to, which is that it downloads from the URL. If it is not cached then it will download the AssetBundle into cache and load it into a variable. If it is cached then it will NOT download and will load the AssetBundle cache into a variable.
According to:
https://blogs.unity3d.com/2020/04/09/learn-to-save-memory-usage-by-improving-the-way-you-use-assetbundles/, it says that
"If you provide a version or a hash argument to the UnityWebRequestAssetBundle API, Unity stores your AssetBundle data into the disk cache. If you do not provide these arguments, Unity uses the memory cache. Note that Addressables uses the disk cache by default. This behavior can be controlled via the UseAssetBundleCache field."
I have been experimenting and have not really been able to correctly figure this out. Using DumbGameDev's "Asset Bundle Unity Web Request" as a base I have tried to perform
UnityWebRequestAssetBundle.GetAssetBundle(uri, version.Value);
to add a version to it so it can cache the download. But I am getting cannot convert FsmInt to uint error.
Someone has successfully achieved this here:
https://forum.unity.com/threads/asset-bundle-saved-in-cache-but-allways-download-again-on-restart.618169/However, with my limited coding knowledge, even following it I was unable to achieve what I wanted. I was wondering if someone could get a UnityWebRequestAssetBundle to download and cache the AssetBundle. If the action is run again and it sees that there is a cached AssetBundle from that download link it shouldn't redownload it and simply put the AssetBundle into a variable object just like "WWWAssetBundle".
I have already gotten in contact with DumbGameDev's tcmeric and he stated that it was best I asked here. I ask this because you guys have created another UnityWebReuqest command with "Web Download Request" and I am wondering if you knew how to do UnityWebRequestAssetBundle
Any help is appreciated, thank you.