Search Unity

Building assets from script

Discussion in 'Addressables' started by hexaust_, Nov 21, 2018.

  1. hexaust_

    hexaust_

    Joined:
    Mar 7, 2015
    Posts:
    23
    I am using 0.4.8-preview and I am trying to add the building of addressable assets in my build procedures. BuildScript.PrepareRuntimeData doesn't seem to exist anymore. What's the new way to do it?

    Thanks.
     
    AustynPember likes this.
  2. PaulBurslem

    PaulBurslem

    Unity Technologies

    Joined:
    Oct 7, 2016
    Posts:
    79
    This should work for now:
    var context = new AddressablesBuildDataBuilderContext(AddressableAssetSettingsDefaultObject.Settings);
    AddressableAssetSettingsDefaultObject.Settings.ActivePlayerDataBuilder.BuildData<AddressablesPlayerBuildResult>(context);

    In the next release, we have wrapped up this functionality into static helper methods to make calling from script easier. It will be this:

    AddressableAssetSettingsDefaultObject.Settings.BuildPlayerContent();
     
    aferon likes this.