How to download AssetBundle only if newer than cached AssetBundle?

I’m confused about the purpose of the “version” parameter of AssetBundles. I’d like my game to download an assetBundle only if it is newer than the cached assetBundle. But since the version is assigned on the game side at download, I don’t see how to know if the version on the server is newer.

Is it possible to download an assetBundle only if it is newer than the cached assetBundle?

The only thing I can think of is to have the game always download (never cache) a small asset bundle, “latestversions.assetbundle” that contains data about which the latest versions of the large asset bundles are on the server. Then use that info to decide whether or not to download the large asset bundles. Is that how others are doing it, or am I missing something? Otherwise, asset bundle “version” seems pretty useless to me.

The Version parameter for AssetBundles was for the old 4.x Asset Bundles system. The new 5.x Asset Bundles system has basically what you described - one main asset bundle called the “Asset Bundle Manifest” which tracks the version of all the other asset bundles. You download that one first, then download all the others as needed based on the version data (used as a hash rather than version number int in the new system) it gives you.

Take a look at New AssetBundle build system in Unity 5.0 - Unity Engine - Unity Discussions or the docs for more info on the new system.

1 Like

Thanks a ton! I have downloaded the sample project listed in that thread and am checking it out now.