Search Unity

Package Assets Not Included in Asset Bundles

Discussion in 'Package Manager' started by deemen, Feb 21, 2019.

  1. deemen

    deemen

    Joined:
    Dec 29, 2013
    Posts:
    17
    Any assets located in Packages but referred to by asset bundles in the main Assets folder do not seem to get included in the asset bundle like other dependencies usually do. For example, if a prefab in the Assets folder references a shader in the Packages folder. The prefab is included in the bundle but the shader is not. This is despite the fact that selecting the prefab and choosing "Select Dependencies" will correctly highlight the shader in the Packages folder.

    This problem was found while working with the Post Processing package in a game that makes heavy use of asset bundles. See full bug report here: https://github.com/Unity-Technologies/PostProcessing/issues/766

    In that particular instance there is a workaround with the Graphics settings, but in general I think this reduces the usefulness of packages anything other than Scripts.
     
  2. mathieur

    mathieur

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    29
    I can confirm that this is the case and have filed a bug under https://jira.hq.unity3d.com/browse/PAX-840. We will see if this behaviour can be corrected. It does seem like this should work as there should be little difference between assets under Assets and assets under Packages.
     
  3. deemen

    deemen

    Joined:
    Dec 29, 2013
    Posts:
    17
    Thanks, looking forward to fix!
     
  4. deemen

    deemen

    Joined:
    Dec 29, 2013
    Posts:
    17
    As a secondary (and possibly worse) problem, when we copy the package assets into the project they can get referenced by multiple asset bundles leading to the assets being copied into each. For shaders the loading / unloading of duplicate shaders seems to break materials and rendering. We spent the last 2-3 days tracking this down. So if this bug is fixed, users must be able to choose which bundle the package assets go into in order to avoid asset duplication.
     
  5. mathieur

    mathieur

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    29
    Very good point! Thank you for bringing it up. I made a note of it, and we will be sure to take this into consideration when creating the fix.
     
  6. zornor90

    zornor90

    Joined:
    Sep 16, 2015
    Posts:
    142
    Any news on this? We also use asset bundles heavily and the post processing shaders are very prone to breaking in builds since we are including them through the package manager