Search Unity

  1. Click here to receive a gift with your purchase of Unity Pro or Unity Enterprise.
    Dismiss Notice
  2. 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

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:
    29
    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:
    422
unityunity