Unity Addressables
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.
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
AddressableScriptHolder.cs
using UnityEngine;
using UnityEngine.AddressableAssets;
namespace SeckinCengiz
{
public class AddressableScript : MonoBehaviour
{
public AssetReference assetReference;
void Start()
{
assetReference.InstantiateAsync();
}
}
}
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
-
Create a new Bucket and configure its settings
-
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.
-
Copy the url path
https://storage.googleapis.com/yourbucketname
-
Configure an addressable profile with a remote url
-
Build asset bundles and upload to the bucket that you have just created.
-
Configure “DefaultLocalGroup” settings. Set “Build Path” to “Remote Build Path” and “Load Path” to “Remote Load Path”
-
Configure “AddressableAssetSettings”. Enable “Build Remote Catalog” option to be able to update assets remotly.
Releted Links
- Official Addressables Manuel - Docs
- Simplify your content management with Addressables - More about pipeline
- Addressables-Sample GitHub Repository - Example
- Unity CDN - Unity Cloud Content Delivery Network