Runtime Studio

Addressables

Resolve stable runtime asset references through custom libraries and resolvers.

Addressables

Runtime Studio does not depend on Addressables directly. Addressable content is exposed through runtime asset libraries and reference resolvers.

Implement IRuntimeAssetLibrary when a project needs a custom source of assets. Implement IAssetReferenceResolver when saved data needs to turn a stable ID back into a loaded Unity object.

Use stable IDs for saved references. Do not use a temporary instance ID or a scene-only object name as the only identifier. When a save is loaded, the resolver should find the asset in an assigned library and return the correct object.

Provide an Addressables library

An Addressables integration can expose the loaded assets as a normal Runtime Studio library. Runtime Studio asks the library for items of the type needed by the current picker.

csharp
using System;
using System.Collections.Generic;
using Fullscreen.RuntimeStudio.Runtime;
using UnityEngine;
using Object = UnityEngine.Object;

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

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

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

    public Object ResolveAsset(string assetId, Type objectType)
    {
        return MyAddressablesCache.Find(assetId);
    }
}

Register the library after its Addressables content has loaded:

csharp
EditorAssetLibraryRegistry.LoadLibrary(new AddressablesLibrary());

If the project needs a separate resolver, implement IAssetReferenceResolver with a priority, GetAssets, ResolveAsset, and TryGetAssetId. Resolve by the stable asset ID first and use the saved name only as a fallback.