Search Unity

Generating Asset Bundle CRCs manually to prevent unnecessary Asset Rebuild

Discussion in 'Scripting' started by insanetheta, May 2, 2014.

  1. insanetheta

    insanetheta

    Joined:
    Jul 23, 2012
    Posts:
    4
    Hey All,

    My team's game has been growing rapidly since our launch and with that our build time has grown tremendously due to the rebuilding of asset bundles. CRC values seem like the best way to do a comparison against a bundle to make sure nothing has changed within, but Unity unfortunately provides no way to get that CRC value except as an "out" parameter of the build itself.

    I have since implemented this C# CRC-32 solution: http://damieng.com/blog/2006/08/08/calculating_crc32_in_c_and_net, and am attempting to follow as close as I can to how Unity says that they generate their CRC-32, by generating a hash of the uncompressed contents of the folder. Unfortunately my result, while still an accurate CRC-32 value, is inconsistent with the one that Unity's build produces.

    I am now unsure if I can use this resulting CRC-32 to decide whether or not to rebuild the bundle. Does anyone know how to generate exactly the CRC-32 value that Unity produces?