Search Unity

How to make an asset addressable using AssetPostProcessor?

Discussion in 'Addressables' started by mnarimani, Jul 17, 2019.

  1. mnarimani

    mnarimani

    Joined:
    Mar 27, 2017
    Posts:
    212
    I need two things in AssetPostProcessor:
    1- I need to know if an asset is marked as addressable or not.
    2- If the asset is addressable, set its address.

    How can I do this?
     
  2. WeltenbauerRenn

    WeltenbauerRenn

    Joined:
    Jun 20, 2017
    Posts:
    14
    For me this works

    // get guid of asset
    AddressableAssetSettings settings = AddressableAssetSettingsDefaultObject.Settings;
    AddressableAssetEntry entry = settings.CreateOrMoveEntry(guid);


    I'm not sure if you need to set the group dirty (EditorUtility.SetDirty)
     
    mnarimani likes this.
  3. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    315