Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Caching asset bundles from StreamingAssets without loading?

Discussion in 'Asset Bundles' started by PW_Dave, Nov 21, 2018.

  1. PW_Dave

    PW_Dave

    Joined:
    Feb 9, 2017
    Posts:
    26
    I've implemented a system for my current project to include a startup set of asset bundles in the StreamingAssets folder to seed the cache when our app is first installed. (Apple apparently doesn't like you to download anything before you can interact with your app for the first time.)

    At initial startup, I use UnityWebRequest.GetAssetBundle(uri, cachedAssetBundle, crc) to "download" the bundles from StreamingAssets into the cache and then discard the bundles. Our loading system then uses the same UnityWebRequest call to download bundles from the CDN, so the seeding works seamlessly.

    However, when I use UnityWebRequest to load the bundles from StreamingAssets, the overhead of actually loading the bundle is noticeable. Is there any way to get the bundles into the cache from StreamingAssets without loading them, and subsequently throwing them away?
     
    Last edited: Nov 26, 2018
  2. PW_Dave

    PW_Dave

    Joined:
    Feb 9, 2017
    Posts:
    26
    So, I take it that's a "NO"?