Search Unity

[Case 1168633] BundlePackingMode.PackTogetherByLabel won't work

Discussion in 'Addressables' started by Favo-Yang, Jun 14, 2019.

  1. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    268
    BundlePackingMode.PackTogetherByLabel should create a bundle per unique set of labels, but it creates a bundle per asset.

    BundleScriptPackedModel line 376,

    Code (CSharp):
    1. foreach (var entryGroup in labelTable)
    2. {
    3.     foreach (var a in entryGroup.Value)
    4.     {
    5.         var allEntries = new List<AddressableAssetEntry>();
    6.         a.GatherAllAssets(allEntries, true, true);
    7.         GenerateBuildInputDefinitions(allEntries, bundleInputDefs, assetGroup.Name, entryGroup.Key);
    8.     }
    9. }
    Fix,

    Code (CSharp):
    1. foreach (var entryGroup in labelTable)
    2. {
    3.     var allEntries = new List<AddressableAssetEntry>();
    4.     foreach (var a in entryGroup.Value)
    5.         a.GatherAllAssets(allEntries, true, true);
    6.     GenerateBuildInputDefinitions(allEntries, bundleInputDefs, assetGroup.Name, entryGroup.Key);
    7. }
     
    Last edited: Jun 14, 2019
  2. PaulBurslem

    PaulBurslem

    Unity Technologies

    Joined:
    Oct 7, 2016
    Posts:
    47
    Hello, thank you for pointing this out. We will get this fixed in the next release of Addressables.
     
    Favo-Yang likes this.