Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question How to get exactly size of bundle?

Discussion in 'Addressables' started by sctiendat, Sep 22, 2021.

  1. sctiendat

    sctiendat

    Joined:
    Mar 14, 2020
    Posts:
    22
    With my Addressable groups structure, I have a "Car_Library" group with Local build and load path, that contains shared asset for all groups. And I have many asset group like "Car_1", "Car_2" groups with Remote build and load path. Example, when I get the bundle size with "GetDownloadSizeAsync" function, the size = size of "Car_1" + size of "Car_Library". If the remote group has reference to many local group, the size = size of Remote group + size of Local Group 1 + ... + size of Local group 'n'.
    So when download, I only need to download size of "Car_1", but show the size need to download = size of "Car_1" + size of "Car_Library". How can I get the exactly only size of "Car_1" ? Have any function to do this?
     
  2. sctiendat

    sctiendat

    Joined:
    Mar 14, 2020
    Posts:
    22
    can anyone help me? :(
     
  3. phobos2077

    phobos2077

    Joined:
    Feb 10, 2018
    Posts:
    350
    This sounds like a bug. Which version are you using? Are you using any custom asset bundle providers?
    At least when calling AsyncOperationHandle.GetDownloadStatus() - the correct size is returned (at least in recent versions).

    You should probably create a bug report. Ideally with a repro project, if you can (they usually ask for it).
     
    sctiendat likes this.
  4. sctiendat

    sctiendat

    Joined:
    Mar 14, 2020
    Posts:
    22
    Thanks for your reply. But maybe something wrong, I think only AsyncOperationHandle.Result returns the correct size of bundle, GetDownloadStatus() doesn't return it. Did i get it wrong?
     
  5. phobos2077

    phobos2077

    Joined:
    Feb 10, 2018
    Posts:
    350
    I meant calling on handle returned when you actually load bundles. LoadAssetsAsync or DownloadDependenciesAsync
     
  6. sctiendat

    sctiendat

    Joined:
    Mar 14, 2020
    Posts:
    22
    Oh yes with LoadAssetsAsync or DownloadDependenciesAsync, the size need to download that correctly.
    But when download each bundle or many bundles, I need to use GetDownloadSizeAsync to get exactly download size for show popup, .v.v...