Search Unity

Question How to include bundles in build AND download updated remote bundles

Discussion in 'Addressables' started by JonBFS, Jan 14, 2021.

  1. JonBFS

    JonBFS

    Joined:
    Feb 25, 2019
    Posts:
    39
    Sorry if this has been mentioned before, but I cannot find the thread.

    I want to generate addressable asset bundles and include it in my Unity Cloud build. Then, if I want to update any of the bundles, I can download the newest bundle from my Amazon S3 bucket.
    ----
    If I set my build profile to Local, the bundles are correctly generated to my build, but then it can't find any updated bundles (because the Load path is set to look at itself only)
    screenshot_Thursday, January 14, 2021_13h51m32s_002_.png

    If I set my build profile to Remote, the bundles are not included in my build, but it will find my bundles (because it's loading from my URL variable that I set at runtime)
    screenshot_Thursday, January 14, 2021_13h51m15s_001_.png

    What can I do to get my bundles included in the build and able to find remote bundles?
     
  2. JonBFS

    JonBFS

    Joined:
    Feb 25, 2019
    Posts:
    39
    Bump sorry. I think this must be a common use case and am confused at where to go from here. I suppose most people don't build addressables via Unity Cloud?
     
  3. zhuxianzhi

    zhuxianzhi

    Joined:
    Mar 30, 2015
    Posts:
    122
    AddressableAssetSettings is a global setting, you should set it to Remote.
    Then you set up a group individually, either local or remote.
     
  4. JonBFS

    JonBFS

    Joined:
    Feb 25, 2019
    Posts:
    39
    Thank you @zhuxianzhi

    So what you're saying is I should set my global setting (Profile) to Remote to so that it will download asset bundles from the AB.AssetBundleURL.RemotePath variable that I set during runtime. Then, change each Group's path?

    The default is the same setting from AddressableAssetSettings. What should I change the build and/or load path to?

    screenshot_Tuesday, January 19, 2021_12h13m29s_001_.png
     
  5. zhuxianzhi

    zhuxianzhi

    Joined:
    Mar 30, 2015
    Posts:
    122
    The first step is to set the Remote Load Path to the CDN path, such as https://cnd.com/XXX/
    Step 2 Upload the content of build Load Path to the above CDN.
     
  6. JonBFS

    JonBFS

    Joined:
    Feb 25, 2019
    Posts:
    39
    @zhuxianzhi
    The Load Path is determined during runtime. That is why I already have it set to a variable AB.AssetBundleURL.Remote

    The question I have is that I want to
    1. include my asset bundles in my app (not download it)
    2. update my asset bundles from my CDN path that i set at runtime
     
  7. zhuxianzhi

    zhuxianzhi

    Joined:
    Mar 30, 2015
    Posts:
    122
    Use the local load path and build local path, the group will be packaged into the application.

    If you want to include a group when packaging, you also need to support updates. You can modify the group as a remote group after packaging. (Of course, you may need to modify the source code for perfect support)

    The official guideline is to determine from the beginning whether it is a local group or a remote group.
     
  8. manuelgoellnitz

    manuelgoellnitz

    Joined:
    Feb 15, 2017
    Posts:
    397
    Even when the catalog is set to remote, there is a fallback version in the build.