KHAIRUL AZANNI AMRAN
KHAIRUL AZANNI AMRAN

Reputation: 45

How to delete a specific cached unity asset bundle?

Hi I was wondering if it is possible to delete specific cache instead deleting all cached asset bundle using Caching.CleanCache. Any suggestion if it is possible?

Upvotes: 1

Views: 3709

Answers (1)

Akhrorjon
Akhrorjon

Reputation: 154

CleanCache is deprecated, use ClearCache to clear all asset bundles.

To remove asset bundle with all cached versions, you can use:

Caching.ClearAllCachedVersions("YourCachedAssetBundleName");

this will removes all the cached versions of the given AssetBundle from the cache or use. (P.S "YourCachedAssetBundleName" must not contain dot '.')

Caching.ClearCachedVersion("YourCachedAssetBundleName", hash);

Removes the given version of the AssetBundle.

Upvotes: 4

Related Questions