Search Unity

[bug?] BundlePackingMode.PackSeparately comment is ambiguous.

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

  1. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    302
    Maybe this is a bug, or the comment/documentation is ambiguous.

    BundleAssetGroupSchema.cs

    Comment for PackSeparately said, "Create a bundle per entry. This is useful if each entry is a folder as all sub entries will go to the same bundle."

    Tooltip for m_BundleMode said, "Controls how bundles are packed. If set to PackTogether, a single asset bundle will be created for the entire group, with the exception of scenes, which are packed separately. If set to PackSeparately, an asset bundle will be created for each top level entry in the group."

    Need a clear definition for top level entry. It seems hint that all asset under a folder packs into a bundle. However the implement just pack each asset a bundle (maybe this is the intention).

    Code (CSharp):
    1. if (packingMode == BundledAssetGroupSchema.BundlePackingMode.PackSeparately)
    2. {
    3.     foreach (var a in assetGroup.entries)
    4.     {
    5.         var allEntries = new List<AddressableAssetEntry>();
    6.         a.GatherAllAssets(allEntries, true, true);
    7.         GenerateBuildInputDefinitions(allEntries, bundleInputDefs, assetGroup.Name, a.address);
    8.     }
    9. }
     
  2. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    954
    we'll work on making that a bit more clear. thanks.
     
  3. Michael_Emond

    Michael_Emond

    Joined:
    Nov 16, 2016
    Posts:
    12
    Hey there @Favo-Yang !

    Would you be so kind as to point me in a direction to how you got the "assetGroup"? I've been looking around and having a hard time with all the namespaces and stuff.

    Thanks!
     
  4. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    302
  5. Michael_Emond

    Michael_Emond

    Joined:
    Nov 16, 2016
    Posts:
    12
    Favo-Yang likes this.