0
\$\begingroup\$

The flow I see people discussing using is the following

  1. In your build asset bundles step, grab the hash of each bundle
  2. Store that on your server somewhere
  3. Fetch those hashes at runtime
  4. Use the Caching.IsVersionCached with that hash to detect if you already have a bundle
  5. If not download the bundle and cache it
  6. success

If this is how you are supposed to do it, why does the main mainfest(example Android.manifest) which can be loaded into a class AssetBundleManifest, have a function to get the hashes for you: unity doc

I was able to just use that technique up until now, but I have hit a problem where it failed to detect a hash change properly and that function is not giving me back the same hash that I see in one of my other bundles .manifest file

Hashes:

AssetFileHash:

serializedVersion: 2

Hash: a44a4d42247721b8bd6f32531f73f9e3

TypeTreeHash:

serializedVersion: 2

Hash: ea5a42e0fd8ea905efa7aa926a3b8944

I am under the impression that the first value above is what would should match what you had stored on your server.

\$\endgroup\$
0

1 Answer 1

1
\$\begingroup\$

Just an update to this in case a future traveler encounters issues of hashes not seeming to work right. After banging my head against this (as using the server stored hashes had the same problem) all day long, I finally found out what was going on. There was a stealth dupe of an asset being inserted into another bundle. The reason I thought my hashes were not correct is because despite the correct asset being in bundle A, there was the stealth copy of the image in bundle B that was the old version. Unity was choosing to use the one in B. This stealth asset does not appear in the manifest for bundle B and is not mentioned in the browser as a warning duplicate asset... Truly a mystery. Makes me wonder how much dupe garbage file size is being used up by other stealth assets...

\$\endgroup\$
1
  • 2
    \$\begingroup\$ Good find! How did you track down and identify this duplicate? \$\endgroup\$
    – DMGregory
    Commented Jan 17, 2019 at 14:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .