Reputation: 2813
I'm using AssetBundles in my game and want to let the user to clear AssetBundle cache in the settings page. I've tried to use Caching.CleanCache but it returns "false" because I'm using AssetBundle cache in the settings page.I have tried to load an empty scene and clear cache but it won't work either. do I need to restart the app? does anybody know any solution?
Upvotes: 1
Views: 3802
Reputation: 1
For me, calling the following was not enough:
AssetBundle.UnloadAllAssetBundles(false);
bool success = Caching.ClearCache();
I had an assetbundle in cache that was not unloadind with UnloadAllAssetBundles. This situation occurred with a bundle for which I made 2 immediate requests before. The second time, the bundle download failed. The cache stood in that inconsistent state, then not able to unload. So after I solved the 2 requests problem, the above code worked fine.
The 2 requests problem for the same asset bundle, was solved by making the second request wait for the first to complete.
Upvotes: 0
Reputation: 2813
let me answer my question. after doing some research,I found that my game has some unloaded assetbundles. I was able to remove cache after unload all assetbundles.
Upvotes: 2