Search Unity

Unity StandAlone asset bundle LoadFromDisk loading whole bundle

Discussion in 'Asset Bundles' started by tomzigza, Mar 27, 2019.

  1. tomzigza

    tomzigza

    Joined:
    Aug 4, 2017
    Posts:
    31
    The docs say that LoadFromDisk is the fastest way to load a bundle and on devices such as standalone, it only loads the header and loads the specific assets on demand. However in our game which we are porting to windows from mobile, when pulling(from the streaming assets) all the bundles in using LoadFromDisk it takes about a minute and uses over a gig of memory indicating its loading the whole bundle.

    Anyone know what I may be doing wrong?
     
  2. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    Does it behave that way on all platforms or just Windows Mobile?
     
  3. tomzigza

    tomzigza

    Joined:
    Aug 4, 2017
    Posts:
    31
    Its just windows. We do not have this happen on mobile. But mobile is using a different API. it uses the load from cache or download api. In windows we don't need to download as the bundles are all included with the initial download.
     
  4. tomzigza

    tomzigza

    Joined:
    Aug 4, 2017
    Posts:
    31
    We stopped using LoadFromDisk(despite the docs saying it doesnt load content only headers and is super optimized) and we moved to using the web fetching technique that we use on mobile, except we used a file:// url scheme and the problem is gone.
     
  5. Zullar

    Zullar

    Joined:
    May 21, 2013
    Posts:
    651
    Try using BuildAssetBundleOptions.UncompressedAssetBundle

    In my case using BuildAssetBundleOptions.UncompressedAssetBundle increased my asset bundle size from 366MB to 748MB, but the load time dropped from 26sec to 2sec.