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

Load an assets bundle from server only one time?

Discussion in 'Scripting' started by RoMax92, Sep 19, 2017.

  1. RoMax92

    RoMax92

    Joined:
    May 29, 2017
    Posts:
    135
    I'm pretty new on the assets bundles, sorry for my noobiness:
    Can i load an asset bundle from a server and keep it on the device? How?
    My idea is to create some levels, and download a level from the server in the device only if is missing in the device.
    There is a tutorial who explain how to do this?
    Thanks.
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,589
    RoMax92 likes this.
  3. RoMax92

    RoMax92

    Joined:
    May 29, 2017
    Posts:
    135
    Ok, thanks @Peter77, but there is a tutorial who explain what i am trying to do?
    I don't find anything who explain very well.
     
  4. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,722
    Try reading this:
    https://docs.unity3d.com/ScriptReference/Networking.DownloadHandlerAssetBundle-ctor.html

    It also has links to other documentation pages, such as AssetBundle.
    In short, Unity has built-in caching system for AssetBundles, so that AssetBundle could be downloaded, decompressed and cached. APIs for downloading/loading are designed to allow loading from cache seemlessly as well as cleaning the cache and forcing redownload.
     
    RoMax92 likes this.