Search Unity

How to make an asset addressable using AssetPostProcessor?

Discussion in 'Addressables' started by Deleted User, Jul 17, 2019.

  1. Deleted User

    Deleted User

    Guest

    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:
    40
    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)
     
    Deleted User likes this.
  3. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    464