Unity Addressables

1 minute read

Addressable Asset System is the new asset management system that allows developers to call for an asset via its address. All you need to do is mark the asset as “addressable.” Once you do that, it generates an address that you can call from anywhere.

Addressables

To be able to use addressables first, you need to install the “Addressables” Unity package via Package Manager. After that you will see the options under Window/Asset Management/Addressables

Addressables

Addressables

Addressables

AddressableScriptHolder.cs

using UnityEngine;
using UnityEngine.AddressableAssets;

namespace SeckinCengiz
{
    public class AddressableScript : MonoBehaviour
    {

        public AssetReference assetReference;

        void Start()
        {
            assetReference.InstantiateAsync();
        }
    }
}

Addressables

Setup for remote content update

To link assets via Cloud services you need to change paths from local to remote. In this example, I will be using Google Cloud Storage Services but you can also use a different provider like Amazon’s AWS s3 Service.

Steps

  1. Create a new Bucket and configure its settings Addressables

  2. Under permission tab click on “Add members” and type “allUsers” as a new member. Also select the role as “Storage Object Viewer” These settings will make your bucket public for everyone. If you are using Amazon s3 you just need to set a public bucket.

  3. Copy the url path https://storage.googleapis.com/yourbucketname

  4. Configure an addressable profile with a remote url Addressables

Addressables

  1. Build asset bundles and upload to the bucket that you have just created.

  2. Configure “DefaultLocalGroup” settings. Set “Build Path” to “Remote Build Path” and “Load Path” to “Remote Load Path” Addressables

  3. Configure “AddressableAssetSettings”. Enable “Build Remote Catalog” option to be able to update assets remotly. Addressables