Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. On February 28th the Feedback website will shut down and be redirected to the Unity forums. See the full post for more information.
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Unity 2018.3 is now released.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

AssetBundle.UnloadAllAssetBundles() doesn't unload scene bundles

Discussion in 'Asset Bundles' started by PW_Dave, Jan 17, 2019.

  1. PW_Dave

    PW_Dave

    Joined:
    Feb 9, 2017
    Posts:
    12
    I've been doing some testing of the AssetBundle system in order to formulate a plan to support variants with our asset management system. I have a custom editor that exposes most of the raw functionality of the AssetBundle system and I've discovered that AssetBundle.UnloadAllAssetBundles() does not unload scene bundles. Which is kind of annoying.

    My custom editor works fine when I use it to load/unload bundles and I can keep track of everything. But when I open the window during a play session or after closing/recompiling, any scene bundles that are loaded are effectively inaccessible. Due to the following issue (where AssetBundle.GetAllLoadedAssetBundles() doesn't return scene bundles): https://forum.unity.com/threads/ass...etbundles-not-returning-scene-bundles.503657/ , I can't get a reference to the loaded scene bundle. It's basically orphaned and stuck in memory. I have to restart Unity to fix it.

    I'm using Unity 2018.2, in case it's been fixed since then.
     
    unity_QzmvR2WrBsSXAw likes this.
  2. PW_Dave

    PW_Dave

    Joined:
    Feb 9, 2017
    Posts:
    12
    After further work, it turns out that I just need to enter/exit play mode to workaround this issue. Apparently, exiting play mode unloads all bundles including scene bundles. Still, it would be nice to have this fixed.