Search Unity

Fetching Resources from internet

Discussion in 'Editor & General Support' started by Lalitsharma81, Nov 5, 2020.

  1. Lalitsharma81

    Lalitsharma81

    Joined:
    Jun 19, 2020
    Posts:
    13
    Hey all,

    I am currently developing an AR app using unity( for both iOS and Android), functionality is very simple... user will press certain buttons on canvas, and button press will load a model respectively.

    But the problem is Models are very large in size so while deploying app becomes very bulky in size.

    So I wanted to know is there any way where I can store my data on some online storage (gdrive etc) and try to download and set up when the users try to run the app for the first time?

    In that way, while deployment I can avoid the large size of my builds. Also if it is possible I want to up to what extent we can leverage this feature(prefabs, textures, videos, audio files) and where I can learn to implement this.

    thank you
     
  2. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,411
  3. Lalitsharma81

    Lalitsharma81

    Joined:
    Jun 19, 2020
    Posts:
    13
    Thank you for the reference,

    I was able to build and reference my assets from Google drive into my app.

    Now I wanted to understand how to reference cached asset bundles downloaded previously as far as I observed unity maintains a cache of downloaded bundles and one can perform a check to reference locally or download from the internet.

    however, I am not getting a hold of how to this properly I am calling the following, web request for a check.

    UnityWebRequest www = UnityWebRequestAssetBundle.GetAssetBundle(bundleURL, 1, 0);

    here 2nd parameter is the bundle version and the third one is some sort of checksum check, however, I am unable to understand the role of those two numeric parameters and how to use them properly, right now it's working as desired but I have no idea how and what else is happening in backend.
     
  4. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,411