Search Unity

Question Asset Bundle Best Practices

Discussion in 'Asset Bundles' started by EOMedvis, Nov 20, 2020.

  1. EOMedvis

    EOMedvis

    Joined:
    Feb 19, 2019
    Posts:
    94
    Hi Forums experts,

    My team is starting to use asset bundle to store app assets online. I wanted to ask a few question regarding some best practices and some concerns we have.

    1) That's the best place to save asset bundles upon download? Currently we are using Application.PersistentDataPath plus a few custom folders in there. Is this the best and most secure location to store asset bundles?

    2) How secure are asset bundles for Unity. Can a use easily locate and upon the asset bundle to extract all of our ours for their own use, or can they not do that without knowing what the file strings? There are assets in there that are proprietary that we would like to remain secure.

    thank you for your time. :)
     
  2. EOMedvis

    EOMedvis

    Joined:
    Feb 19, 2019
    Posts:
    94
  3. studentutu

    studentutu

    Joined:
    Oct 22, 2017
    Posts:
    121
    1) Leave as is - as it is a better place for them to be in - Unity uses caching (expiring after) so if you need it would not need to change anything to enable it. Also Addressable need it for the same reason
    2) Your asset bundle is secure enough to hold any kind of assets - it is just a binary data + all of the component are essentially guids - so even if the .apk file is decrypted - you still wouldn't get the guid right.
     
  4. tgrotte

    tgrotte

    Joined:
    Apr 17, 2019
    Posts:
    25
    1) I'd recommend using Unity's Caching API. There are some nice optional perks you get with it, like incremental building and CRC checking for data integrity. So when you use it to download asset bundles from your server, you can pass a version hash/number representing the latest version of each bundle. If the user's device already has that version downloaded, it won't waste time and data downloading it again. This can be especially important if your app is large.