Search Unity

Question Asset Bundles building location breaks dependencies links

Discussion in 'Asset Bundles' started by plamaliy, Sep 3, 2022.

  1. plamaliy

    plamaliy

    Joined:
    May 3, 2015
    Posts:
    1
    Hi all!

    Unity 2020.3.30f1
    macOS High Sierra

    custom assets management
    buildOptions = BuildAssetBundleOptions.StrictMode | BuildAssetBundleOptions.AssetBundleStripUnityVersion

    Here is my situation:
    • The project has 2 bundles A and B.
    • Assets in B have dependencies on assets in A.
    • Building asset bundles 2 times in different folders 1/ and 2/ (updating one of the bundles when the path to the project changed or on another build machine).
    • Moving pairs of bundles (A&B) to storage
    In runtime:
    • Loading A
    • Loading B
    • Loading assets from B and using them
    Results:
    • 1/A + 1/B = success
    • 2/A + 2/B = success
    • 1/A + 2/B = missing
    • 2/A + 1/B = missing
    When rebuilding one of the asset bundles even with some changes (changed hash) it still works fine with the old asset bundle from the same build location:
    • 1/A(new) + 1/B = success
    • 1/A + 1/B(new) = success
    • 2/A(new) + 2/B = success
    • 2/A + 2/B(new) = success
    So the problem occurs only if bundles was built in different locations
    Is the way to avoid this?

    Thanks for any help!