Search Unity

AssetBundle.GetAllLoadedAssetBundles not returning scene bundles?

Discussion in 'Scripting' started by PW_Dave, Nov 8, 2017.

  1. PW_Dave

    PW_Dave

    Joined:
    Feb 9, 2017
    Posts:
    30
    I'm working on an asset system for use during development that has multiple asset bundle managers to handle nightly bundle builds as well as local bundle builds for new/updated assets. The local bundle manager needs to check and make sure that existing nightly bundles are unloaded before trying to load the new bundles. However, when it has to load a scene bundle it doesn't work because none of the loaded scene bundles are in the list returned by GetAllLoadedAssetBundles. Is this intentional? Are scene bundles handled differently internally, or might this be fixed eventually? I just want to know if I should go ahead and implement my own shared list of loaded bundles to workaround this issue. Thanks.
     
  2. Spartan301

    Spartan301

    Joined:
    Aug 31, 2011
    Posts:
    20
    Did you ever find a solution to this?
     
  3. PW_Dave

    PW_Dave

    Joined:
    Feb 9, 2017
    Posts:
    30
    Nope. Since this post, I've fixed some issues with loading/unloading bundles (basically give assets and scenes a frame to initialize before unloading bundles), so this issue is not as high a priority as it was. I suspect that I'll revisit this issue after the new year. I'd recommend tracking the loaded bundles manually until they patch this issue, or release a new version of Unity with it fixed.
     
  4. amcakebread

    amcakebread

    Joined:
    Nov 8, 2016
    Posts:
    28
    still not fixed
     
  5. Brandstifter

    Brandstifter

    Joined:
    Jan 24, 2020
    Posts:
    3
    still not fixed (Unity 2021.1.22f1)
     
  6. AndrewSkow

    AndrewSkow

    Unity Technologies

    Joined:
    Nov 17, 2020
    Posts:
    91
    This is fixed in the context of bug report IN-14019 and will be in 2022.2.8f1, and 2023.X releases. As part of the fix any loaded Scene AssetBundles will be included when AssetBundle.GetAllLoadedAssetBundles is called.

    It is unlikely this would have a negative side effect for existing projects, e.g. if some existing code was not expecting scenes to unload on this call. But, to be cautious, we are not immediately backporting the change to 2021.