Unity addressables

From claude-dev-suite/claude-dev-suite · View interactive version

Unity addressables is an AI agent skill from the GitHub repository claude-dev-suite/claude-dev-suite. Unity Addressables — AssetReference, async loading, labels, groups, build profiles, remote content, Cloud Content Delivery integration, content catalogs and updates. USE WHEN: replacing `Resources.Load`, async asset loading, scene streaming, remote content, DLC delivery, runtime asset hot-swap, spli

How to use this skill

Skill file

Unity Addressables

Why Addressables (vs Resources / direct refs)

AssetReference

public class EnemySpawner : MonoBehaviour {
    [SerializeField] private AssetReferenceGameObject enemyPrefab;
    [SerializeField] private Transform spawnPoint;

    public async void Spawn() {
        AsyncOperationHandle<GameObject> handle =
            enemyPrefab.InstantiateAsync(spawnPoint.position, Quaternion.identity);
        var enemy = await handle.Task;
        // listen for destroy → release
        enemy.GetComponent<Enemy>().Killed += () => Addressables.ReleaseInstance(enemy);
    }
}

InstantiateAsync reference-counts; release with ReleaseInstance to free memory.

Loading by label

var handle = Addressables.LoadAssetsAsync<AudioClip>("music", null);
var clips = await handle.Task;        // all assets with label 'music'
// later
Addressables.Release(handle);

Build profiles

Set in Window > Asset Management > Addressables > Profiles. CI builds invoke Addressables.BuildPlayerContent() or AddressablesPlayerBuildResult.

Content updates (without rebuilding the player)

  1. Mark a group as Content Update Restriction = Can Change Post Release.
  2. Build content → produces addressables_content_state.bin (commit).
  3. Later, Build > Update a Previous Build → produces incremental bundles → upload to CDN. Player downloads the new catalog on launch.

Cloud Content Delivery (Unity Gaming Services)

Anti-patterns

| Anti-pattern | Fix |

|---|---|

| Resources.Load for big asset graphs | Migrate to Addressables |

| Forgetting to Release | Reference-count leaks → run Profiler memory snapshot regularly |

| Massive single group | Split by usage (per-level, per-language, music vs SFX) |

| Sync WaitForCompletion on remote loads | Always async; show loading UI |

| Different bundle compression per platform forgotten | Default LZ4 for all desktop/mobile; Uncompressed for WebGL on tiny assets |

Production checklist

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.