unity-yooasset-design
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBefore calling any skill in this module: if you are about to call a skill with parameters guessed from its name or description, STOP — read this file (or fetch its schema via) first. If you already have the parameter definitions from recommend/schema, you may proceed straight to dryRun.GET /skills/recommend?includeSchema=true
调用本模块中的任何技能之前: 如果你打算根据技能名称或描述猜测参数来调用技能,请停止操作——先阅读本文档(或通过获取其 schema)。如果你已经从推荐/schema中获得了参数定义,可以直接进入dryRun阶段。GET /skills/recommend?includeSchema=true
Triggers
触发场景
- Writing or reviewing YooAsset code
- Initializing packages
- Loading assets via handles
- Setting up hot-update/download
- Choosing a play mode
- 编写或审查 YooAsset 代码、初始化 package、用句柄加载资源、配置热更/下载、选择运行模式
- 编写或审查YooAsset代码
- 初始化包
- 通过句柄加载资源
- 配置热更新/下载
- 选择运行模式
- 编写或审查 YooAsset 代码、初始化 package、用句柄加载资源、配置热更/下载、选择运行模式
YooAsset - Design Rules
YooAsset - 设计规范
Advisory module. Every rule is distilled from YooAsset v2.3.18 (2025-12-04) source at . Each rule cites a concrete file/line so the reasoning is auditable and the AI does not improvise against stale memory.
Assets/YooAsset/Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).
本模块为指导性模块。每条规范均提炼自路径下的YooAsset v2.3.18(2025-12-04)源码。每条规范都引用了具体的文件/行号,因此其依据可被审计,AI不会基于过时记忆随意发挥。
Assets/YooAsset/模式:仅文档模式——无REST技能限制;可在任何操作模式(Approval / Auto / Bypass)下自由加载。
When to Load This Module
何时加载本模块
Load before writing or reviewing any of:
- /
YooAssets.Initialize()/CreatePackage()bootstrap codeDestroy() - default package shortcuts: ,
YooAssets.SetDefaultPackage(...),YooAssets.LoadAssetAsync(...)YooAssets.CreateResourceDownloader(...) - with any of the 5
ResourcePackage.InitializeAsync(...)variantsEPlayMode - ,
LoadAssetSync/Async,LoadSubAssetsAsync,LoadAllAssetsAsync,LoadRawFileAsyncand their matchingLoadSceneAsyncusage / releaseHandle - Patch flow:
RequestPackageVersionAsync → UpdatePackageManifestAsync → CreateResourceDownloader → BeginDownload - construction (Buildin / Cache / Editor / WebServer / WebRemote / custom)
FileSystemParameters - /
IDecryptionServices/IRemoteServicesimplementationsIWebDecryptionServices - Editor-side and
AssetBundleBuilder.Run(...)configurationAssetBundleCollector - Any code branching on /
EOperationStatus/EFileClearModePackageDetails
在编写或审查以下代码之前加载本模块:
- /
YooAssets.Initialize()/CreatePackage()启动代码Destroy() - 默认包快捷方法:、
YooAssets.SetDefaultPackage(...)、YooAssets.LoadAssetAsync(...)YooAssets.CreateResourceDownloader(...) - 带有任意5种变体的
EPlayModeResourcePackage.InitializeAsync(...) - 、
LoadAssetSync/Async、LoadSubAssetsAsync、LoadAllAssetsAsync、LoadRawFileAsync及其对应的LoadSceneAsync使用/释放逻辑Handle - 补丁流程:
RequestPackageVersionAsync → UpdatePackageManifestAsync → CreateResourceDownloader → BeginDownload - 构造(Buildin / Cache / Editor / WebServer / WebRemote / 自定义)
FileSystemParameters - /
IDecryptionServices/IRemoteServices实现IWebDecryptionServices - 编辑器端和
AssetBundleBuilder.Run(...)配置AssetBundleCollector - 任何基于/
EOperationStatus/EFileClearMode分支的代码PackageDetails
Critical Rule Summary (memorize even if you skip the sub-docs)
核心规范总结(即使跳过子文档也需牢记)
| # | Rule | Source anchor |
|---|---|---|
| 1 | Call | |
| 2 | | |
| 3 | | |
| 4 | Every | |
| 5 | | |
| 6 | YooAsset 2.3.18 includes default-package static shortcuts on | |
| 7 | | |
| 8 | Before | |
| 9 | Downloader callbacks ( | |
| 10 | | |
| 11 | The patch flow is strictly ordered: | |
| 序号 | 规范 | 源码锚点 |
|---|---|---|
| 1 | 在调用任何 | |
| 2 | | |
| 3 | | |
| 4 | 每个 | |
| 5 | | |
| 6 | YooAsset 2.3.18在 | |
| 7 | | |
| 8 | 在调用 | |
| 9 | 下载器回调( | |
| 10 | | |
| 11 | 补丁流程必须严格按顺序执行: | |
Sub-doc Routing
子文档导航
| Sub-doc | When to read |
|---|---|
| INIT.md | |
| PLAYMODE.md | All 5 |
| HANDLES.md | |
| LOADING.md | |
| UPDATE.md | Patch flow, |
| FILESYSTEM.md | |
| BUILD.md | |
| PITFALLS.md | 30 concrete hallucination pitfalls + legacy API migration section |
| 子文档 | 阅读时机 |
|---|---|
| INIT.md | |
| PLAYMODE.md | 所有5种 |
| HANDLES.md | |
| LOADING.md | |
| UPDATE.md | 补丁流程、 |
| FILESYSTEM.md | |
| BUILD.md | |
| PITFALLS.md | 30个具体的易混淆陷阱 + 旧版API迁移章节 |
Routing to Other Modules
其他模块导航
- Asmdef & assembly layout for YooAsset consumers → load asmdef
- Async orchestration across multiple YooAsset operations → load async
- Architecture-level decisions (Addressables vs YooAsset, single-package vs multi-package) → load architecture
- Performance review of load/release hot paths → load performance
- YooAsset使用者的Asmdef与程序集布局 → 加载asmdef
- 跨多个YooAsset操作的异步编排 → 加载async
- 架构层面决策(Addressables vs YooAsset、单包 vs 多包) → 加载architecture
- 加载/释放热路径的性能审查 → 加载performance
Version Scope
版本范围
This document targets YooAsset 2.3.18 (2025-12-04). Key recent history:
- 2.3.18 — added file-system parameter,
UNPACK_FILE_SYSTEM_ROOT,EFileClearMode.ClearBundleFilesByLocations.RawFileBuildParameters.IncludePathInHash - 2.3.17 — [CRITICAL] fixed a CRC-validation bug that let corrupted downloads pass verification on 2.3.15/2.3.16. Also fixed a Package-destroy race where an in-flight load could block unload.
AssetBundle - 2.3.16 — removed the downloader parameter (use
timeouton the cache file system instead).DOWNLOAD_WATCH_DOG_TIMEgained a requiredIFilterRuleproperty.FindAssetType - 2.3.15 — bumped the manifest binary format; installers built with 2.3.15+ are not readable by 2.3.14 or earlier clients and vice versa. Added ,
FILE_VERIFY_MAX_CONCURRENCY, previewStripUnityVersion(underUseWeakReferenceHandle).YOOASSET_EXPERIMENTAL
Source: .
Assets/YooAsset/CHANGELOG.md:5-275本文档针对YooAsset 2.3.18(2025-12-04)。近期关键版本历史:
- 2.3.18 — 新增文件系统参数、
UNPACK_FILE_SYSTEM_ROOT、EFileClearMode.ClearBundleFilesByLocations。RawFileBuildParameters.IncludePathInHash - 2.3.17 — [重要修复] 修复了一个CRC验证漏洞,该漏洞曾导致2.3.15/2.3.16版本中损坏的下载包通过验证。同时修复了包销毁时的竞态问题,即正在进行的加载可能会阻塞卸载。
AssetBundle - 2.3.16 — 移除了下载器的参数(改用缓存文件系统上的
timeout)。DOWNLOAD_WATCH_DOG_TIME新增了必填的IFilterRule属性。FindAssetType - 2.3.15 — 升级了清单二进制格式;使用2.3.15+版本构建的安装包无法被2.3.14或更早版本的客户端读取,反之亦然。新增、
FILE_VERIFY_MAX_CONCURRENCY,预览特性StripUnityVersion(需开启UseWeakReferenceHandle)。YOOASSET_EXPERIMENTAL
来源:。
Assets/YooAsset/CHANGELOG.md:5-275Migration Notes (hallucination shield)
迁移说明(防混淆)
| Legacy API (pre-2.3.18) | Status in 2.3.18 | Replacement | Source |
|---|---|---|---|
| Removed in 2.3.16 | Assign | |
| Breaking change in 2.3.16 — compilation breaks | Implement | |
| Old manifest binary (pre-2.3.15 client reading a 2.3.15+ manifest, or vice versa) | Wire-incompatible | Rebuild + re-ship installer; no runtime bridge exists | |
| Does not exist — method names include | | |
| Outdated rule — 2.3.18 has this default-package shortcut | Prefer | |
| Does not exist | | |
| Does not exist | | |
| Does not exist in YooAsset | Subscribe | |
| Field is a plain delegate, not an event | Assign once: | |
When in doubt, read the cited source — not your memory.
| 旧版API(2.3.18之前) | 2.3.18中的状态 | 替代方案 | 来源 |
|---|---|---|---|
| 2.3.16中已移除 | 在 | |
无 | 2.3.16中为破坏性变更——编译会失败 | 实现 | |
| 旧版清单二进制(2.3.15之前的客户端读取2.3.15+版本的清单,或反之) | 完全不兼容 | 重新构建并发布安装包;不存在运行时桥接方案 | |
| 不存在——方法名称包含 | 在调用 | |
| 旧规则已过时——2.3.18中存在该默认包快捷方法 | 优先使用 | |
| 不存在 | | |
| 不存在 | | |
用于资源同步的 | YooAsset中不存在 | 订阅 | |
| 该字段是普通委托,而非事件 | 仅赋值一次: | |
如有疑问,请阅读引用的源码——而非依赖你的记忆。