Search Unity

Check if asset is downloaded?

Discussion in 'Addressables' started by tertle, Nov 11, 2018.

  1. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,761
    Is there any way I can check if an asset is downloaded before attempting to load it?

    I'd like to provide a warning to users on mobile data before downloading huge (100mb+) assets.

    I remember doing this previously with asset bundles and with version comparisons in caching, but I'm not seeing anywhere that I can do this easily with addressables.
     
  2. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    We haven't added this yet, but we most likely will add some kind of "how much will download" api.

    Coming in the next release will be a `Addressables.DownloadDependencies("x")` that will let you download (but not load) bundles associated with address "x". And starting in the next release or so, we will include the built-bundle size in the catalog data. These are building blocks on which we can build the downlaod-size API. we haven't done it yet, because we want to make sure we implement it in the way that aligns with the long-term direction of addressables. Either way, it's recorded in our backlog.

    -Bill
     
    dd_ss and optimise like this.
  3. jsmouret

    jsmouret

    Joined:
    Apr 4, 2015
    Posts:
    8
    Would it be possible to also cancel the download ?
    asking for a friend :)
     
  4. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    you can tell your friend it's on the list, but not in yet :)
     
    aurelien-morel-ubiant likes this.
  5. jsmouret

    jsmouret

    Joined:
    Apr 4, 2015
    Posts:
    8
    While I'm there, it would be nice to be able to easily tweak the hardcoded cache settings:

    new CachedProvider.Settings() { MaxLRUAge = 1, MaxLRUCount = 10 ...

    We have big bundles and keeping them in memory is not an option.
    Thanks!
     
  6. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    Cache settings exposure is coming in the next release (this month)