Search Unity

Building Addressables using custom build script

Discussion in 'Unity Build Automation' started by CameronND, Jun 16, 2021.

  1. CameronND

    CameronND

    Joined:
    Oct 2, 2018
    Posts:
    89
    Hi, how can I get cloud build to build addressables using a custom build script?
    It seems to always run the default build script that is provided with addressables.
     
    nick-morhun likes this.
  2. rajivrao

    rajivrao

    Unity Technologies

    Joined:
    Feb 19, 2019
    Posts:
    111
    Hi @CameronND -- have you tried setting up a pre-build script in your Config window?
     
  3. CameronND

    CameronND

    Joined:
    Oct 2, 2018
    Posts:
    89
    Hi thanks for the reply.
    I am unsure of how to use the pre build scripts. Could you provide an example please?
     
  4. CameronND

    CameronND

    Joined:
    Oct 2, 2018
    Posts:
    89
    In case anyone is interested, I managed to get it working by defining a static method in my code and adding it to the Pre-Export field in the cloud build config settings.
    All the method does is set the
    UnityEditor.AddressableAssets.AddressableAssetSettingsDefaultObject.Settings.ActivePlayerDataBuilderIndex
    value to the correct index for my build script.
     
    nicloay, nick-morhun and AdminXRBASE like this.