Search Unity

How can I view why an asset bundle is dependent on another

Discussion in 'Asset Bundles' started by mr-bulldops, Jun 26, 2018.

  1. mr-bulldops

    mr-bulldops

    Joined:
    Dec 2, 2016
    Posts:
    23
    I was wondering if there was an easy way to see exactly why an assetbundle is dependent on another? I didn't see anything in the asset bundle browser and couldn't find anything in the documentation.

    Unity Version: 2017.4.1f1

    Thanks
     
  2. AlienMe

    AlienMe

    Joined:
    Sep 16, 2014
    Posts:
    93
    We haven't found an easy way to do this. IMO, the Asset Bundle system works as a magic black box, where you don't have any visibility into what goes where, and why.

    Assuming you have 2 bundles, A and B, and you want to find out why Bundle B depends on A:

    What we have tried in the past:
    1) (Making sure you have everything in Git, or backed up), remove Bundle A, and then in the Bundle Browser you can see which assets are auto-included.

    2) In another case, we modified the source code for Asset Bundle Browser, to print to the console when a dependency was making it list another bundle in the browser window. This would produce a lot of output, but then you could dig and find out the culprit.

    Both options are primitive and cumbersome.
     
  3. hromoyDron

    hromoyDron

    Joined:
    Jan 24, 2013
    Posts:
    90
    Is there any progress on this topic?
     
  4. nevaermorr

    nevaermorr

    Joined:
    Jan 23, 2015
    Posts:
    2
    In the AssetBundle Browser, if you select a bundle in the left panel, then select an asset in the list to the right, you'll see some info about that asset just below the list. One of these info messages lists all the assets that this asset depends on, along with the bundles these assets are in. It looks like this:

    TheInspectedAssetName
    Is dependent on other bundle’s asset(s) or auto included asset(s):
    auto: SomeOtherAsset
    bundleA: AnotherAsset
    bundleB: YetAnotherAsset


    So if you want to find out why, say, bundleA is dependent on bundleB, you can go through all the assets included in bundleA and find which assets are listing bundleB asset in the info block mentioned above.

    It's still a manual process and may be tedious if your bundle is big, but should be fairly doable.