Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

prepare for content update by script?

Discussion in 'Addressables' started by Marks001, Jun 14, 2019.

  1. Marks001

    Marks001

    Joined:
    Dec 11, 2014
    Posts:
    27
    Hi, I did not find the api of prepare-for-content-update and build-for-content-update like AddressableAssetSettings.BuildPlayerContent(). I want to automate building by script.
    Is there any associated api? Thanks!
     
    cjdbeans likes this.
  2. cjdbeans

    cjdbeans

    Joined:
    Jun 29, 2017
    Posts:
    8
    Am also interested in this. I see the code that handles this in ContentUpdateScript but some of the key methods are internal only (GatherModifiedEntries, etc). Want to be able to do content updates as part of a build pipeline (using batchmode)
     
    LarsGameloft likes this.
  3. Marks001

    Marks001

    Joined:
    Dec 11, 2014
    Posts:
    27
    @cjdbeans, Thanks, this can only ask for help from the official.
    @unity_bill
    hi bill, Is this in your development plan? or there have other resolutions?
     
    LarsGameloft and hugebug like this.
  4. Marks001

    Marks001

    Joined:
    Dec 11, 2014
    Posts:
    27
    Refresh
     
    LarsGameloft likes this.
  5. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    1,023
    take a look at how our UI does this in Editor\GUI\AddressableAssetsSettingsGroupEditor.cs. Everything the UI does is public for you to replicate. If you need to customize the update code, things should be public, but we very easily could have missed some calls. If you have specific items you end up needing to be public, let us know.
     
  6. LarsGameloft

    LarsGameloft

    Joined:
    Jun 4, 2019
    Posts:
    16
    @unity_bill So I can create a new content update group using CreateContentUpdateGroup (its public) but I need to pass a list of the entries that have been modified. For that I have to use GatherModifiedEntries and pass the path of the bin, but GatherModifiedEntries is internal so I cannot use it. Do you know of any other way to get the modified entries with the bin file besides calling GatherMOdifiedEntries?

    Thank you.
     
    Last edited: Jul 30, 2019
  7. LarsGameloft

    LarsGameloft

    Joined:
    Jun 4, 2019
    Posts:
    16
    Anyone has found a way to read the addressables bin and create a list of modified entries to create the new addressable bundles?, I can only find internal functions to do this.
    Thank you
     
  8. dirty-rectangle

    dirty-rectangle

    Joined:
    Apr 23, 2015
    Posts:
    40
    I'm about to start looking running a programmatic content update in UCB
    Could the prepare and build steps be run a part of the same PreExport stage build step?
    In the content-update-workflow documentation it states "Before running the prepare operation, Unity recommends branching your version control system.",
    but if the content update prepare and build could be run from a single UCB project build then does that negate the need to do the branching?
    LarsGameloft I assume for now that we will need to copy the addressable package in to our Packages folder to make GatherModifiedEntries () public to do this.
     
  9. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    1,023
    GatherModifiedEntries is the correct thing to be calling, and yes, we accidentally did not make it public. We have a branch for what will become a 1.2.x with this change, but won't be able to release it until closer to the end of August or early September (because we are locked in a 1.1.x for the initial part of our leaving "-preview" state).

    So for now, you can probably use reflection, or just hand-edit the package you have. In a month or so, it'll be public.
     
    MFG-jkhoo and LarsGameloft like this.
  10. Marks001

    Marks001

    Joined:
    Dec 11, 2014
    Posts:
    27
    You can copy the addressable package source code to your project assets, make the function what you need public, and remove addressables from "manifest.json", that's what I've been doing so far.
     
    unity_bill and LarsGameloft like this.
  11. LarsGameloft

    LarsGameloft

    Joined:
    Jun 4, 2019
    Posts:
    16
    Thank you for the replies ;)
     
  12. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    @unity_bill Could someone explain to me why the GatherModifiedEntries always returns the same set of assets between builds? I have all my Groups set as: Update Restriction: Cannot Change Post Release. Is there anything else I'm missing?

    I'm trying to understand it, as I'm using that method to prevent builds from rebuilding if they don't have to.
     
    Last edited: Feb 29, 2020
unityunity