Search Unity

MergeMode.Intersection unexpected behaviour

Discussion in 'Addressables' started by redbox9, Oct 16, 2018.

  1. redbox9

    redbox9

    Joined:
    Apr 27, 2018
    Posts:
    7
    Hi,

    According to _this_ post, MergeMode.Intersection should return only assets that match all labels. This is somewhat true but only if each label has been used in at least one bundle.

    Say I have 3 labels, LabelA, LabelB and LabelC and run the following code:

    Code (CSharp):
    1. private void Start()
    2.     {
    3.         Addressables.LoadAssets<GameObject>(new List<object>() { "LabelA", "LabelB", "LabelC" }, null, Addressables.MergeMode.Intersection).Completed += Load_Completed;
    4.     }
    5.  
    6.     private void Load_Completed(IAsyncOperation<IList<GameObject>> obj)
    7.     {
    8.         foreach (var a in obj.Result)
    9.         {
    10.             Debug.Log(a.name);
    11.         }
    12.     }
    The following situations occur:



    ^ Returns assets from AssetCollectionB: Expected



    ^ Returns assets from AssetCollectionA: Unexpected



    ^ Returns assets from AssetCollectionB: Unexpected



    ^ Returns assets from neither collection: Expected

    This means if we have 20 bundles using LabelB and LabelC and only one bundle using all 3, then decide to remove/change the single bundle using all 3, suddenly 20 bundles would be loaded where they weren't before.

    Is this intended?
     
  2. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    thanks for letting us know, we'll look into it.

    -Bill