Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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:
    30
    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:
    30
    So, I take it that's a "NO"?