Search Unity

Can't understand Content Update workflow

Discussion in 'Addressables' started by dnnkeeper, Sep 20, 2018.

  1. dnnkeeper

    dnnkeeper

    Joined:
    Jul 7, 2013
    Posts:
    84
    I'm trying to figure out how to update addressable assets correctly.

    Let's assume I have a simple Cube.prefab that is put into RemoteGroup in addressables window. It is not marked as static (why do I ever need to?) and is spawned at OnEnable in the main scene with a simple script function:

    Addressables.Instantiate<GameObject>("Cube", position, rotation);


    After I 'build and run' this Cube asset will be correctly downloaded and cached on the device.

    Now I change color or a material in the Cube.prefab in the editor.

    What should I do next to receive an updated prefab on device? Do I need "Build For Content Update"? Do I need to enter Play Mode with 'Packed Play Mode' selected to rebuild ServerData assets?

    I've tried both and nothing worked. But when I manually added my new CubeMaterial to the RemoteGroup and made a 'Build For Content Update' it has changed on the device!

    But I do not understand why and how this is working... ServerData now contains several duplicated remotegroup_scenes_all with various id and I can't understand If I need all of them or not. If I delete old ones, new content updates no longer gets delivered to the device. But if every minor update have to dulicate an entire bundle without removing outdated it will get out of hand pretty fast.

    Here is my testing project with useful AddressableLoader script if someone likes to reproduce this behaviour.
     

    Attached Files:

    Deleted User likes this.
  2. s-vovik

    s-vovik

    Joined:
    Mar 24, 2017
    Posts:
    15
    I didn't dig into "Build For Content Update" yet. But I use Play with Packed Play Mode for updating content. After that it's not enough to upload only changed bundles to web server. You also need to upload all catalog_[timestamp].json and StreamingAssets (catalog.json & settings.json). Now yor old build will upload new assets correctly with no need to make a new build.

    If you dig deeper and look at settings.json, you can see that there are group locators. This file tells us where to find catalog_ [timestamp] .json And this file stores the paths to all the assemblies