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 Addressables.UpdateCatalogs - Does it update content or just flag it?

Discussion in 'Addressables' started by apiotuch_unity, Oct 29, 2020.

  1. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
    I am going through the documentation but it doesn't seem clear to me what this method actually does.

    I am looking for a way to update content that is already downloaded to a device but does not download all the new content that is available.

    e.g. User downloads prefab A. Developer uploads to CDN update to prefab A, and a new Prefab B. User starts the app again and the app checks for Updates, and downloads only prefab A again, but Prefab B does not get downloaded.

    Will Update Catalogs give me a list of updated and new prefabs? Or just what needs to be updated locally?
     
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,795
    I'll flag this with the team, and pass along any insight they have to share.
     
  3. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    736
    So, it's used in conjunction with our Content Update workflow. So, if you have an application that uses prefab A out in production and you, the developer, can change prefab A and do a Content Update. This will generate a new remote content catalog which you can upload to your CDN along with your updated prefab AssetBundle. Then the code in your App can look for catalog updates while the app is running and download the new catalog update at runtime. With the updated catalog, the new prefab A AssetBundle will then get downloaded and used in any subsequent calls for prefab A.

    To your question about prefabB is "it depends". Since you're not loading prefabs directly, you're loading AssetBundles, it'll depend on if you built prefab B into the same AssetBundle (typically done by having them in the same Addressable Group). If you did, then the AssetBundle that gets downloaded will have prefab B. If it doesn't, then it won't.
     
  4. apiotuch_unity

    apiotuch_unity

    Joined:
    Jun 28, 2019
    Posts:
    138
    So If I make a new group post release, do I need to update the app release as well for users to be able to receive Prefab B?
     
  5. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    736
    You shouldn't need to if it's a remote group. If you make a whole new group all you should have to do is:
    - Create the remote group
    - Build your new content
    - Upload the new bundles and remote catalog to your CDN or wherever

    This assumes that your app release had "Build Remote Catalog" checked when you did your initial build. This still assumes the scenario where prefabB is a dependency of prefabA. The update build will add the group/Asset Bundle for prefabB to the dependencies of the Asset Bundle of prefabA. Then the system will download the new bundle automatically.

    If you're wanting to reference prefabB directly you might have to do an app update as well. It depends on how your app would reference the key for a prefab that didn't exist originally. Most people would probably use labels to work with this. If your app knows about a certain label that you've put on prefabB you'll be able to download it and get the prefab without having to do an app update.
     
  6. chin13577

    chin13577

    Joined:
    May 8, 2017
    Posts:
    16
    I've some questions about
    Addressables.UpdateCatalogs


    if my sound bundle has changed and uploaded to my CDN. so that's means I use only
    1.
    Addressables.CheckForCatalogUpdates
    for checking which catalog has changed.
    2.
    Addressables.UpdateCatalogs

    the sound bundle will update automatically?.

    what if I use
    Addressables.DownloadDependenciesAsync("sound")
    It become the same result?


    upload_2022-3-30_9-35-0.png
     
  7. chin13577

    chin13577

    Joined:
    May 8, 2017
    Posts:
    16
    after I use
    Addressables.UpdateCatalogs

    Does it just update JSON file? I don't see anything downloaded after updating catalogs.
    or I misunderstand something.
    upload_2022-3-30_10-21-20.png