Search Unity

Resolved Do you store Local and Remote bundles at the same folder?

Discussion in 'Asset Bundles' started by vectorized-runner, Aug 31, 2022.

  1. vectorized-runner

    vectorized-runner

    Joined:
    Jan 22, 2018
    Posts:
    398
    In our project we've separated AssetBundles to 2 parts: Local (shipped with player) and Remote (downloaded after the player first installs the game), pretty common.

    I'd like to store all Bundles (both Local and Remote) in the same folder on the device, so that I can just load a Bundle by name, without caring about where it came from.

    Initially I've thought of storing everything in the StreamingAssets, before getting a Player build, I build the Local AssetBundles and store them in StreamingAssets, and it gets shipped to the device. But the documentation says StreamingAssets folder is readonly on mobile platforms, so I guess this means I can't download the Remote bundles to there.

    The documentation also advices to use the persistentDataPath, that solves the Remote issue, but how will I get my Local bundles to the device's persistentDataPath?

    How have you handled this issue? Maybe I don't have to store them in the same folder?

    Edit: I've solved this by storing Local bundles at StreamingAssets, Remote bundles at PersistentDataPath
     
    Last edited: Sep 16, 2022