Search code examples
c#unity-game-engineversionassetbundle

How to set and use asset bundle version in Unity3D?


How to let know WWW.LoadFromCacheOrDownload function to download latest version of asset bundles , so that the above fuction do not use cached asset bundles.


Solution

  • Second parameter of this function is actually the version of asset bundles (WWW LoadFromCacheOrDownload(string url, int version, uint crc = 0);). So if you want to download new one be sure that parameter version gets higher number as its value.

    Usually you do it by having the current version number somewhere online so that the client before loading assets checks the current version and pass it as parameter.

    It is that simple.

    However in Unity3D 5.x I had many problems with WWW.LoadFromCacheOrDownload, as it was always downloading even if the asset should be cached. But maybe it was already fixed.