Search Unity

Would this cause in memory duplication?

Discussion in 'Addressables' started by Skaltum, Jan 28, 2020.

?

Does this cause in memory duplication?

  1. Yes

    0 vote(s)
    0.0%
  2. No

    0 vote(s)
    0.0%
  1. Skaltum

    Skaltum

    Joined:
    Nov 1, 2013
    Posts:
    28
    I am loading a library of prefabs the user can place in a scene. Some of those are more important than others. The important ones should be loaded first (preferably, I know this code doesn't actually guarantee that).

    The important assets are a subset of "all" the assets. Does that mean I load the subset twice or is that handled internally?

    Code (CSharp):
    1. //important is a subset of all
    2. var loadImportant = Addressables.LoadResourceLocationsAsync("dragAndDropImportant");
    3. loadImportant.Completed += operationHandler => {
    4.     OnLoadedDragAndDropLocation(operationHandler);
    5.     var loadAll = Addressables.LoadResourceLocationsAsync("dragAndDropAll");
    6.     loadAll.Completed += OnLoadedDragAndDropLocation;
    7. };