> For the complete documentation index, see [llms.txt](https://docs.fullscreen.no/info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fullscreen.no/info/standalone-assets/runtime-studio/working-with-addressables.md).

# Working with Addressables

Runtime Studio does not depend on Addressables directly. Instead, Addressables are exposed through asset libraries and resolvers.

***

### Core Idea

You connect Addressables to Runtime Studio using:

* `IRuntimeAssetLibrary`
* `IAssetReferenceResolver`

This keeps Runtime Studio decoupled from Unity systems.

***

### Creating an Addressables Library

```cs
public sealed class AddressablesLibrary :
    IRuntimeAssetLibrary
{
    public string LibraryId => "addressables";
    public string DisplayName => "Addressables";

    public IEnumerable<RuntimeAssetLibraryItem> GetItems(Type type)
    {
        foreach (var asset in MyAddressablesCache.All)
        {
            if (type == null || type.IsInstanceOfType(asset))
            {
                yield return new RuntimeAssetLibraryItem(
                    asset,
                    asset.name,
                    asset.name,
                    "Addressables",
                    LibraryId,
                    DisplayName
                );
            }
        }
    }
}
```

***

### Register Library

```cs
EditorAssetLibraryRegistry.LoadLibrary(
    new AddressablesLibrary()
);
```

***

### Resolving Saved References

Runtime Studio stores:

* asset id
* asset name
* asset type

To restore:

```cs
public Object ResolveAsset(
    Type declaredType,
    string assetTypeName,
    string assetId,
    string assetName)
{
    return MyAddressablesCache.Find(assetId)
        ?? MyAddressablesCache.FindByName(assetName);
}
```

***

### Stable IDs

Always provide stable IDs:

```cs
public bool TryGetAssetId(Object asset, out string id)
{
    id = MyAddressablesCache.GetId(asset);
    return id != null;
}
```
