Search Unity

When async loaded assets from an asset bundle are done integrating?

Discussion in 'Editor & General Support' started by Tetrad, Feb 28, 2012.

  1. Tetrad


    Jul 22, 2009
    We have a system in our game where we load a lot of assets dynamically from asset bundles.

    The gist of it is that we call AssetBundle.LoadAsync, yield to the request, and then instantiate/use/whatever the AssetBundleRequest.asset.

    To keep memory down (this is an iOS title), I'd also like to call AssetBundle.Unload( false ). However, if I call this in my loading coroutine immediately after the asset is loaded it seems that the main thread of the game stalls as it forces Application.Integrate Assets In Background.

    Basically I'm asking if there's a way to check to see if the asset integration is completed so I can unload the bundle at that point? Or if I'm going about this entirely the wrong way?
  2. frozenpepper


    Sep 17, 2007
    Resurrecting thread hoping that somebody has new info on this issue.
    We are experiencing the same problem and are not able to get rid of the "Application.Integrate Assets In Background" spike.
    We have tried waiting before calling bundle.Unload(false) one frame, two frames, three frames, 3 seconds... nothing.
    Vsync on and off and still no changes.
    We don't have this spike with every asset bundle we unload, but every (apparently random) x number of seconds) a bundle causes a this spike.
    The spike on device (iOS) is always of either 100, 60 or 30ms (around).
    We are still investigating, but if anybody has any clues ...

    To notice, we are using uncompressed asset bundles.