Unity-Technologies / Addressables-Sample

Demo project using Addressables package
1.29k stars 298 forks source link

ENABLE_CACHING and how to disable caching is never explained. #51

Open djee-ms opened 3 years ago

djee-ms commented 3 years ago

Disabling caching is essential for development, but is explained nowhere. The release notes mention ENABLE_CACHING, but without explanation. The documentation hints at disabling caching, but without explanation.

I found over 10 questions on Unity forums etc. of users trying to disable caching or deleting entries from the cache. They were all struggling, and none of those questions where answered.

How do you disable caching?

kirstenpilla commented 3 years ago

I think what you want to do is disable the "Use Asset Bundle Cache" option for each group. This can be access by: viewing a group in the Inspector > Content Packing & Loading > Advanced Options image

Otherwise you can use Addressables.ClearDependencyCacheAsync to clear the cache for specific AssetBundles.

ENABLE_CACHING is an engine define that is only disabled for specific platforms (PS4 and Switch). I don't think it's possible to disable manually unless you are compiling a custom version of Unity yourself : )

djee-ms commented 3 years ago

Thanks for the tip. I didn't find any time to test it yet, sorry, but that sounds like what I wanted indeed. I'll leave that issue open though, because ENABLE_CACHING is mentioned in the Release Notes of Addressables, so if it's an internal-only flag then it should be explained as such; I'd assume Release Notes to talk about flags that users can action, not internal ones.