Agent SkillsBesty0728/Unity-Skills › unity-addressables-design

unity-addressables-design

GitHub

提供Unity Addressables源码级设计规则,覆盖1.22.3与2.9.1版本。指导异步加载、资源管理、热更新及版本迁移,确保代码合规性。

SkillsForUnity/unity-skills~/skills/addressables-design/SKILL.md Besty0728/Unity-Skills

Trigger Scenarios

编写Addressables初始化或异步加载代码 审查AssetReference使用或AsyncOperationHandle释放 配置目录更新或内容下载逻辑 进行Addressables版本迁移(如1.22.3至2.9.1) 用户提及'可寻址'或'热更'相关需求

Install

npx skills add Besty0728/Unity-Skills --skill unity-addressables-design -g -y
More Options

Non-standard path

npx skills add https://github.com/Besty0728/Unity-Skills/tree/main/SkillsForUnity/unity-skills~/skills/addressables-design -g -y

Use without installing

npx skills use Besty0728/Unity-Skills@unity-addressables-design

指定 Agent (Claude Code)

npx skills add Besty0728/Unity-Skills --skill unity-addressables-design -a claude-code -g -y

安装 repo 全部 skill

npx skills add Besty0728/Unity-Skills --all -g -y

预览 repo 内 skill

npx skills add Besty0728/Unity-Skills --list

SKILL.md

Frontmatter
{
    "name": "unity-addressables-design",
    "description": "Source-anchored design rules for Unity Addressables across two versions — 1.22.3 on Unity 2022 and 2.9.1 on Unity 6 — covering initialization, async operation handles, asset\/scene loading, catalog updates, content download, AssetReference, and version migration. Use when writing or reviewing Addressables code, loading assets\/scenes asynchronously, setting up hot-update or catalog refresh, or migrating between versions, even if the user just says \"可寻址\" or \"热更\". 为 Unity Addressables 提供源码锚定的设计规则(覆盖两个版本,Unity 2022 用 1.22.3、Unity 6 用 2.9.1;含初始化、异步操作句柄、资源\/场景加载、目录更新、资源下载、AssetReference、版本迁移);当用户要编写或审查 Addressables 代码、异步加载资源\/场景、配置热更新或目录刷新时使用。"
}

Addressables - Design Rules

Advisory module. Every rule is distilled from Unity Addressables source at two versions:

  • 1.22.3com.unity.addressables@1.22.3 (Unity 2022, min 2019.4)
  • 2.9.1com.unity.addressables@8460f1c9c927 (Unity 6, min 2023.1)

Each rule cites a concrete file/line so the reasoning is auditable and the AI does not improvise against stale memory.

Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).

When to Load This Module

Load before writing or reviewing any of:

  • Addressables.InitializeAsync() / LoadContentCatalogAsync() bootstrap code
  • LoadAssetAsync<T> / LoadAssetsAsync<T> / InstantiateAsync and their handle release
  • LoadSceneAsync / UnloadSceneAsync — especially with SceneReleaseMode (2.9.1)
  • CheckForCatalogUpdatesUpdateCatalogsCleanBundleCache patch flow
  • GetDownloadSizeAsync / DownloadDependenciesAsync / ClearDependencyCacheAsync
  • AssetReference / AssetReferenceT<T> field declarations and load/release
  • Any code that calls WaitForCompletion() or uses AsyncOperationHandle directly
  • Migration from 1.22.3 to 2.9.1 — removed APIs, changed overload signatures

Version Difference Matrix

Area 1.22.3 (Unity 2022) 2.9.1 (Unity 6)
Non-Async variants (LoadAsset, Instantiate, LoadScene, etc.) [Obsolete] — compile warning Removed — compile error
IList<object> multi-key overloads Present Replaced by IEnumerable
SceneReleaseMode enum Does not exist New — controls bundle lifetime on scene unload
LoadSceneAsync releaseMode param Absent SceneReleaseMode.ReleaseSceneWhenSceneUnloaded default
LoadAssetsAsync<T>(string key, ...) Does not exist New string-key overload
UpdateCatalogs(bool autoCleanBundleCache, ...) Does not exist New overload
LegacyResourcesLocator / LegacyResourcesProvider Present Removed
DiagnosticEvent / DiagnosticEventCollector Present Removed
ResourceManagerEventCollector Present Removed
ResourceManager.RegisterDiagnosticCallback() [Obsolete] Removed
InitializationOperation property [Obsolete], returns default Removed
BinaryCatalogInitializationData Does not exist New
CachedFileProvider Does not exist New

Critical Rule Summary

# Rule Version Source anchor
1 All non-Async variants (LoadAsset, Instantiate, LoadScene, UnloadScene, GetDownloadSize, DownloadDependencies, Initialize, LoadContentCatalog) are [Obsolete] in 1.22.3 and removed in 2.9.1. Always use the *Async form. Both Addressables.cs:1.22.3:862-2226, Addressables.cs:2.9.1 (absent)
2 Every AsyncOperationHandle returned by a Load/Instantiate call MUST be released via Addressables.Release(handle). Forgetting leaks the AssetBundle in memory indefinitely — even after the scene unloads. Both AsyncOperationHandle.cs:2.9.1:178-203
3 WaitForCompletion() blocks the calling thread synchronously. On WebGL it is unsupported and throws. Never call it on the main thread in production; use await handle.Task or the Completed event instead. Both AsyncOperationHandle.cs:2.9.1:178-203
4 LoadSceneAsync in 2.9.1 adds SceneReleaseMode releaseMode (default ReleaseSceneWhenSceneUnloaded). If a Single-mode load unloads your additive scene and you need the bundle to stay alive, pass OnlyReleaseSceneOnHandleRelease and release the handle manually. 2.9.1 ISceneProvider.cs:2.9.1:14-26, Addressables.cs:2.9.1:1914
5 Multi-key overloads changed from IList<object> to IEnumerable in 2.9.1. The old IList<object> overloads no longer exist — pass IEnumerable or string[]. 2.9.1 Addressables.cs:2.9.1:1148,1566,1636
6 LegacyResourcesLocator and LegacyResourcesProvider were removed in 2.9.1. Do not reference them in code targeting Unity 6. 2.9.1 Runtime/ResourceLocators/ (absent in 2.9.1)
7 ResourceManager.RegisterDiagnosticCallback() was [Obsolete] in 1.22.3 and removed in 2.9.1. Use the Addressables Profiler window instead. 2.9.1 ResourceManager.cs:1.22.3:353 (absent in 2.9.1)
8 Catalog update flow is strictly ordered: CheckForCatalogUpdates → UpdateCatalogs. In 2.9.1, UpdateCatalogs(bool autoCleanBundleCache, ...) can auto-clean stale bundles in one call. Both Addressables.cs:2.9.1:2092-2147
9 AssetReference.LoadAssetAsync<T>() returns a handle that must be released via assetRef.ReleaseAsset(), NOT Addressables.Release(handle). Mixing the two causes double-release exceptions. Both AssetReference.cs:1.22.3:44-46
10 InitializationOperation property (1.22.3) is [Obsolete] and returns default. Do not await it. Use await Addressables.InitializeAsync() instead. 1.22.3 Addressables.cs:1.22.3:981-982

Sub-doc Routing

Sub-doc When to read
INIT.md InitializeAsync / LoadContentCatalogAsync / catalog loading order / autoReleaseHandle semantics
HANDLES.md AsyncOperationHandle<T> lifecycle — Completed, WaitForCompletion, Release, IsDone, Status, OperationException, ref-counting
LOADING.md LoadAssetAsync, LoadAssetsAsync (all overloads + version diff), MergeMode, InstantiateAsync, ReleaseInstance
SCENE.md LoadSceneAsync / UnloadSceneAsync / SceneInstance.ActivateAsync / SceneReleaseMode (2.9.1) / activateOnLoad=false pattern
UPDATE.md CheckForCatalogUpdatesUpdateCatalogs flow / autoCleanBundleCache (2.9.1) / CleanBundleCache / ResourceLocatorInfo
DOWNLOAD.md GetDownloadSizeAsync / DownloadDependenciesAsync / ClearDependencyCacheAsync / DownloadStatus struct
ASSETREF.md AssetReference / AssetReferenceT<T> / LoadAssetAsync / ReleaseAsset / OperationHandle property / IsDone guard
PITFALLS.md 30 concrete hallucination pitfalls with version tags + legacy API migration section

Routing to Other Modules

  • Asmdef layout for Addressables consumers → load asmdef
  • Async orchestration across multiple Addressables operations → load async
  • Architecture-level decisions (Addressables vs YooAsset, group strategy) → load architecture
  • Performance review of load/release hot paths → load performance

Version Scope

This document targets two versions:

  • 1.22.3 — shipped with Unity 2022 LTS. Contains [Obsolete] non-Async variants still present for migration.
  • 2.9.1 — shipped with Unity 6 (2023.1+). All [Obsolete] APIs removed. New SceneReleaseMode, binary catalog format, AutoGroupGenerator.

When a rule applies to only one version it is tagged [1.22.3] or [2.9.1]. Untagged rules apply to both.

Migration Notes (hallucination shield)

Legacy API Status Replacement Source
Addressables.Initialize() [Obsolete] in 1.22.3, removed in 2.9.1 Addressables.InitializeAsync() Addressables.cs:1.22.3:862-864
Addressables.LoadAsset<T>(key) [Obsolete] in 1.22.3, removed in 2.9.1 Addressables.LoadAssetAsync<T>(key) Addressables.cs:1.22.3:992-1007
Addressables.LoadAssets<T>(keys, cb, mode) [Obsolete] in 1.22.3, removed in 2.9.1 Addressables.LoadAssetsAsync<T>(keys, cb, mode) Addressables.cs:1.22.3:1242-1276
Addressables.Instantiate(key, ...) [Obsolete] in 1.22.3, removed in 2.9.1 Addressables.InstantiateAsync(key, ...) Addressables.cs:1.22.3:1892-1972
Addressables.LoadScene(key, ...) [Obsolete] in 1.22.3, removed in 2.9.1 Addressables.LoadSceneAsync(key, ...) Addressables.cs:1.22.3:2090-2106
Addressables.UnloadScene(handle, ...) [Obsolete] in 1.22.3, removed in 2.9.1 Addressables.UnloadSceneAsync(handle, ...) Addressables.cs:1.22.3:2180-2226
Addressables.GetDownloadSize(key) [Obsolete] in 1.22.3, removed in 2.9.1 Addressables.GetDownloadSizeAsync(key) Addressables.cs:1.22.3:1547
Addressables.DownloadDependencies(key) [Obsolete] in 1.22.3, removed in 2.9.1 Addressables.DownloadDependenciesAsync(key) Addressables.cs:1.22.3:1608
Addressables.InitializationOperation [Obsolete] in 1.22.3, removed in 2.9.1 await Addressables.InitializeAsync() Addressables.cs:1.22.3:981-982
LoadResourceLocationsAsync(IList<object> keys, ...) Present in 1.22.3, removed in 2.9.1 LoadResourceLocationsAsync(IEnumerable keys, ...) Addressables.cs:2.9.1:1148
GetDownloadSizeAsync(IList<object> keys) Present in 1.22.3, removed in 2.9.1 GetDownloadSizeAsync(IEnumerable keys) Addressables.cs:2.9.1:1566
DownloadDependenciesAsync(IList<object> keys, mode, ...) Present in 1.22.3, removed in 2.9.1 DownloadDependenciesAsync(IEnumerable keys, mode, ...) Addressables.cs:2.9.1:1636
LegacyResourcesLocator / LegacyResourcesProvider Present in 1.22.3, removed in 2.9.1 Use Addressables groups for all assets Runtime/ResourceLocators/LegacyResourcesLocator.cs:1.22.3
ResourceManager.RegisterDiagnosticCallback(...) [Obsolete] in 1.22.3, removed in 2.9.1 Addressables Profiler window ResourceManager.cs:1.22.3:353
DiagnosticEvent / DiagnosticEventCollector Present in 1.22.3, removed in 2.9.1 Addressables Profiler / custom IProfilerEmitter Runtime/ResourceManager/Diagnostics/:1.22.3

When in doubt, read the cited source — not your memory.

Version History

  • ec9f870 Current 2026-07-05 14:39

Same Skill Collection

SkillsForUnity/unity-skills~/skills/adr/SKILL.md
SkillsForUnity/unity-skills~/skills/animator/SKILL.md
SkillsForUnity/unity-skills~/skills/architecture/SKILL.md
SkillsForUnity/unity-skills~/skills/asmdef/SKILL.md
SkillsForUnity/unity-skills~/skills/asset/SKILL.md
SkillsForUnity/unity-skills~/skills/async/SKILL.md
SkillsForUnity/unity-skills~/skills/batch/SKILL.md
SkillsForUnity/unity-skills~/skills/blueprints/SKILL.md
SkillsForUnity/unity-skills~/skills/bookmark/SKILL.md
SkillsForUnity/unity-skills~/skills/camera/SKILL.md
SkillsForUnity/unity-skills~/skills/cinemachine/SKILL.md
SkillsForUnity/unity-skills~/skills/cleaner/SKILL.md
SkillsForUnity/unity-skills~/skills/component/SKILL.md
SkillsForUnity/unity-skills~/skills/console/SKILL.md
SkillsForUnity/unity-skills~/skills/debug/SKILL.md
SkillsForUnity/unity-skills~/skills/decal/SKILL.md
SkillsForUnity/unity-skills~/skills/dotween/SKILL.md
SkillsForUnity/unity-skills~/skills/editor/SKILL.md
SkillsForUnity/unity-skills~/skills/event/SKILL.md
SkillsForUnity/unity-skills~/skills/gameobject/SKILL.md
SkillsForUnity/unity-skills~/skills/graphics/SKILL.md
SkillsForUnity/unity-skills~/skills/history/SKILL.md
SkillsForUnity/unity-skills~/skills/importer/SKILL.md
SkillsForUnity/unity-skills~/skills/inspector/SKILL.md
SkillsForUnity/unity-skills~/skills/light/SKILL.md
SkillsForUnity/unity-skills~/skills/material/SKILL.md
SkillsForUnity/unity-skills~/skills/navmesh/SKILL.md
SkillsForUnity/unity-skills~/skills/netcode-design/SKILL.md
SkillsForUnity/unity-skills~/skills/netcode/SKILL.md
SkillsForUnity/unity-skills~/skills/optimization/SKILL.md
SkillsForUnity/unity-skills~/skills/package/SKILL.md
SkillsForUnity/unity-skills~/skills/patterns/SKILL.md
SkillsForUnity/unity-skills~/skills/perception/SKILL.md
SkillsForUnity/unity-skills~/skills/performance/SKILL.md
SkillsForUnity/unity-skills~/skills/physics/SKILL.md
SkillsForUnity/unity-skills~/skills/postprocess/SKILL.md
SkillsForUnity/unity-skills~/skills/prefab/SKILL.md
SkillsForUnity/unity-skills~/skills/probuilder/SKILL.md
SkillsForUnity/unity-skills~/skills/profiler/SKILL.md
SkillsForUnity/unity-skills~/skills/project-scout/SKILL.md
SkillsForUnity/unity-skills~/skills/project/SKILL.md
SkillsForUnity/unity-skills~/skills/sample/SKILL.md
SkillsForUnity/unity-skills~/skills/scene-contracts/SKILL.md
SkillsForUnity/unity-skills~/skills/scene/SKILL.md
SkillsForUnity/unity-skills~/skills/script-roles/SKILL.md
SkillsForUnity/unity-skills~/skills/script/SKILL.md
SkillsForUnity/unity-skills~/skills/scriptableobject/SKILL.md
SkillsForUnity/unity-skills~/skills/scriptdesign/SKILL.md
SkillsForUnity/unity-skills~/skills/shader/SKILL.md
SkillsForUnity/unity-skills~/skills/shadergraph/SKILL.md
SkillsForUnity/unity-skills~/skills/SKILL.md
SkillsForUnity/unity-skills~/skills/smart/SKILL.md
SkillsForUnity/unity-skills~/skills/terrain/SKILL.md
SkillsForUnity/unity-skills~/skills/test/SKILL.md
SkillsForUnity/unity-skills~/skills/testability/SKILL.md
SkillsForUnity/unity-skills~/skills/timeline/SKILL.md
SkillsForUnity/unity-skills~/skills/ui/SKILL.md
SkillsForUnity/unity-skills~/skills/uitoolkit/SKILL.md
SkillsForUnity/unity-skills~/skills/urp/SKILL.md
SkillsForUnity/unity-skills~/skills/validation/SKILL.md
SkillsForUnity/unity-skills~/skills/volume/SKILL.md
SkillsForUnity/unity-skills~/skills/workflow/SKILL.md
SkillsForUnity/unity-skills~/skills/xr/SKILL.md
SkillsForUnity/unity-skills~/skills/yooasset-design/SKILL.md
SkillsForUnity/unity-skills~/skills/yooasset/SKILL.md
SkillsForUnity/unity-skills~/SKILL.md
SkillsForUnity/unity-skills~/skills/dotween-design/SKILL.md
SkillsForUnity/unity-skills~/skills/shadergraph-design/SKILL.md
SkillsForUnity/unity-skills~/skills/unitask-design/SKILL.md
SkillsForUnity/unity-skills~/skills/yaml-editing/SKILL.md

Metadata

Files
0
Version
ec9f870
Hash
26f40fb5
Indexed
2026-07-05 14:39

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-09 05:27
浙ICP备14020137号-1 $Carte des visiteurs$