Search Unity

Merge Mode is obsolete

Discussion in 'Addressables' started by bz_apps, Oct 19, 2020.

  1. bz_apps

    bz_apps

    Joined:
    Aug 19, 2014
    Posts:
    72
    Hi, can you tell me what i should use to replace the following:

    Code (CSharp):
    1.  
    2. // assetList is a list of AssetReferences
    3.  
    4. var loadHandle = Addressables.LoadAssetsAsync<CustomClass>(new List<object>(assetList), OnListItemLoaded, Addressables.MergeMode.Intersection);
    5.         if (!loadHandle.IsValid())
    6.         {
    7.             Debug.Log("Unable to Load all addressabels: {loadHandle.Status} {loadHandle.OperationException}");
    8.             Event_Error?.Invoke(loadHandle);
    9.             return;
    10.         }
    11.  
    12.         await loadHandle.Task;
    13.  
    14.         if (loadHandle.Status != AsyncOperationStatus.Succeeded || loadHandle.Result == null)
    15.         {
    16.             Debug.LogError("Addressable Asset has failed.");
    17.             Event_Error?.Invoke(loadHandle);
    18.             return;
    19.         }
    I get an message about it being obsolete now. Is that just he merge mode?
     
  2. Lucas-Hehir

    Lucas-Hehir

    Joined:
    Jul 2, 2014
    Posts:
    41
    I believe the issue may be with your first parameter:

    new List<object>(assetList)


    You can just pass in assetList now. It doesn't need to be a List<object> anymore, that was recently deprecated.
     
    Smireles likes this.
  3. bz_apps

    bz_apps

    Joined:
    Aug 19, 2014
    Posts:
    72

    Thanks @Vanilla-Plus , that seems to have done the trick!
     
    Smireles and Lucas-Hehir like this.