Search Unity

How can I download files after boot?

Discussion in 'Android' started by Clicksurfer, Jul 6, 2020.

  1. Clicksurfer

    Clicksurfer

    Joined:
    Aug 17, 2014
    Posts:
    77
    Hi all,

    I have an Android game which is very asset-heavy, and because of that I want to download most of its resources (images) during runtime, rather than have them part of the game's assets by default.

    Is there a name for this process? How can I achieve this? I couldn't find a single tutorial on the matter.

    Thanks in advance!
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,440
  3. Clicksurfer

    Clicksurfer

    Joined:
    Aug 17, 2014
    Posts:
    77
    Hi, thanks a lot!
    WebRequests are awesome and perfect for my needs.

    I implemented this by doing the following:
    1. Checking against a list of filenames to see if I have them on my device or not
    2. If not, use WebRequests to download them from online
    3. Use SaveTextureToFile to save the downloaded image on the device
    4. From onwards, use WebRequests again to access the saved texture (but this time the url is for where I saved the image locally, not the web server)