Skip to content
unity-yooasset-design logo

YooAsset - Design Rules

unity-yooasset-design

Source-anchored design rules for YooAsset v2.3.18. Load this before writing any ResourcePackage / InitializeAsync / AssetHandle / Downloader / FileSystem / AssetBundleBuilder code to avoid hallucinated APIs, PlayMode-parameter mismatch, and Handle leaks. Triggers: YooAsset, YooAssets, ResourcePac...

SKILL.md

Full skill instructions

YooAsset - Design Rules

Advisory module. Every rule is distilled from YooAsset v2.3.18 (2025-12-04) source at Assets/​YooAsset/. 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:

  • YooAssets.Initialize() / CreatePackage() / Destroy() bootstrap code
  • default package shortcuts: YooAssets.SetDefaultPackage(...), YooAssets.LoadAssetAsync(...), YooAssets.CreateResourceDownloader(...)
  • ResourcePackage.InitializeAsync(...) with any of the 5 EPlayMode variants
  • LoadAssetSync/​Async, LoadSubAssetsAsync, LoadAllAssetsAsync, LoadRawFileAsync, LoadSceneAsync and their matching Handle usage / release
  • Patch flow: RequestPackageVersionAsync → UpdatePackageManifestAsync → CreateResourceDownloader → BeginDownload
  • FileSystemParameters construction (Buildin / Cache / Editor / WebServer / WebRemote / custom)
  • IDecryptionServices / IRemoteServices / IWebDecryptionServices implementations
  • Editor-side AssetBundleBuilder.Run(...) and AssetBundleCollector configuration
  • Any code branching on EOperationStatus / EFileClearMode / PackageDetails

Critical Rule Summary (memorize even if you skip the sub-docs)

#RuleSource anchor
1Call YooAssets.Initialize() before any CreatePackage() and keep it as a process-level singleton. A second call only logs a warning and returns, but normal architecture should gate it with YooAssets.Initialized. The call creates a [{nameof(YooAssets)}] driver GameObject via DontDestroyOnLoad to pump OperationSystem.Update(). Do not Destroy this driver yourself.Runtime/​YooAssets.cs:38-64
2ResourcePackage.InitializeAsync(...) has no separate EPlayMode argument: it infers play mode from the concrete InitializeParameters subclass. The five built-in subclasses map 1:1 to the five modes; an unknown subclass throws NotImplementedException, while a recognized but semantically wrong subclass wires the wrong file-system topology and fails later.Runtime/​ResourcePackage/​ResourcePackage.cs:107-135, 170-181, Runtime/​InitializeParameters.cs:8-110
3EditorSimulateMode works only when UNITY_EDITOR is defined; WebPlayMode works only when UNITY_WEBGL is defined (and every other mode is rejected on WebGL).Runtime/​ResourcePackage/​ResourcePackage.cs:160-197
4Every AssetHandle / SubAssetsHandle / AllAssetsHandle / RawFileHandle / SceneHandle must be released via Release() or Dispose(). Without release, bundles never unload even with AutoUnloadBundleWhenUnused = true.Runtime/​ResourceManager/​Handle/​HandleBase.cs:21-40, Runtime/​InitializeParameters.cs:48-49
5LoadAssetSync/​Async performs a DEBUG-only type guard that rejects any Type derived from UnityEngine.Behaviour and any type not derived from UnityEngine.Object. Treat the restriction as architectural even though the guard is compiled out of non-DEBUG builds.Runtime/​ResourcePackage/​ResourcePackage.cs:1172-1187
6YooAsset 2.3.18 includes default-package static shortcuts on YooAssets (SetDefaultPackage, Load*, CreateResourceDownloader, etc.). They are valid API, but architecture should prefer explicit ResourcePackage references in multi-package or library code.Runtime/​YooAssetsExtension.cs:16, 217-295, 479-506
7RequestPackageVersionAsync() returns RequestPackageVersionOperation (exposes .PackageVersion). There is no UpdatePackageVersionOperation class in 2.3.18 — if you think you remember one, you are confusing it with the older name.Runtime/​ResourcePackage/​ResourcePackage.cs:225-231
8Before UpdatePackageManifestAsync, call UnloadAllAssetsAsync(); YooAsset logs a warning when loaders are still alive.Runtime/​ResourcePackage/​ResourcePackage.cs:242-247
9Downloader callbacks (DownloadFinishCallback / DownloadUpdateCallback / DownloadErrorCallback / DownloadFileBeginCallback) must be assigned before BeginDownload(). They are delegate fields, not events — only one subscriber per slot.Runtime/​DownloadSystem + Runtime/​ResourcePackage/​Operation/​DownloaderOperation.cs:86-101, 330-336
10ResourcePackage.DestroyAsync() must run before YooAssets.RemovePackage(). RemovePackage refuses when InitializeStatus != EOperationStatus.None.Runtime/​YooAssets.cs:177-190, Runtime/​ResourcePackage/​ResourcePackage.cs:210-218
11The patch flow is strictly ordered: InitializeAsync → RequestPackageVersionAsync → UpdatePackageManifestAsync(version) → CreateResourceDownloader → BeginDownload. Jumping ahead (e.g. loading assets between version and manifest) is unsupported.Runtime/​ResourcePackage/​ResourcePackage.cs:225, 238, 972, Samples~/​Space Shooter/​.../​PatchLogic/​FsmNode/​Fsm*.cs

Sub-doc Routing

Sub-docWhen to read
INIT.mdInitialize / Destroy / CreatePackage / TryGetPackage / RemovePackage; single driver GameObject; OperationSystem loop
PLAYMODE.mdAll 5 EPlayMode values, their matching InitializeParameters subclass, platform #if guards, and the runtime dispatch table
HANDLES.mdHandleBase API (Release / IsDone / Progress / Status / LastError / Completed / Task / IEnumerator), AssetHandle.Instantiate*, reference counting, AutoUnloadBundleWhenUnused
LOADING.mdLoadAsset, LoadSubAssets, LoadAllAssets, LoadRawFile, LoadScene — all overloads + Behaviour/​Type rejection + LoadSceneParameters
UPDATE.mdPatch flow, RequestPackageVersionOperation, UpdatePackageManifestOperation, PreDownloadContentOperation, ResourceDownloaderOperation (4 callbacks, pause/​resume/​cancel, Combine)
FILESYSTEM.mdFileSystemParameters + 24 FileSystemParametersDefine constants + 5 factory helpers + IDecryptionServices / IRemoteServices / IWebDecryptionServices
BUILD.mdAssetBundleBuilder.Run(...), BuildParameters (Scriptable / Raw / Simulate), AssetBundleCollector, IFilterRule.FindAssetType, ScriptableBuildParameters.ReplaceAssetPathWithAddress
PITFALLS.md30 concrete hallucination pitfalls + legacy API migration section

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

Version Scope

This document targets YooAsset 2.3.18 (2025-12-04). Key recent history:

  • 2.3.18 — added UNPACK_FILE_SYSTEM_ROOT file-system parameter, 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 AssetBundle load could block unload.
  • 2.3.16 — removed the downloader timeout parameter (use DOWNLOAD_WATCH_DOG_TIME on the cache file system instead). IFilterRule gained a required FindAssetType property.
  • 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, StripUnityVersion, preview UseWeakReferenceHandle (under YOOASSET_EXPERIMENTAL).

Source: Assets/​YooAsset/​CHANGELOG.md:5-275.

Migration Notes (hallucination shield)

Legacy API (pre-2.3.18)Status in 2.3.18ReplacementSource
CreateResourceDownloader(count, retry, timeout) overload / ResourceDownloaderOperation.timeout propertyRemoved in 2.3.16Assign DOWNLOAD_WATCH_DOG_TIME on the CacheFileSystemParameters / BuildinFileSystemParametersCHANGELOG.md:173-177, FileSystemParametersDefine.cs:18
IFilterRule without a FindAssetType propertyBreaking change in 2.3.16 — compilation breaksImplement public string FindAssetType { get; } that returns a Unity asset-type filter stringCHANGELOG.md:179-192
Old manifest binary (pre-2.3.15 client reading a 2.3.15+ manifest, or vice versa)Wire-incompatibleRebuild + re-ship installer; no runtime bridge existsCHANGELOG.md:196-198
YooAssets.LoadAsset(...)Does not exist — method names include LoadAssetSync / LoadAssetAsync, not bare LoadAssetpackage.LoadAssetAsync<T>(location) or YooAssets.LoadAssetAsync<T>(location) after SetDefaultPackageRuntime/​YooAssetsExtension.cs:217-295, Runtime/​ResourcePackage/​ResourcePackage.cs:641-732
YooAssets.LoadAssetAsync(...) marked as hallucinationOutdated rule — 2.3.18 has this default-package shortcutPrefer package.LoadAssetAsync<T>(location) for explicit ownership; static shortcut is acceptable only after YooAssets.SetDefaultPackage(package)Runtime/​YooAssetsExtension.cs:16, 260-295
package.UnloadUnusedAssets() (synchronous)Does not existpackage.UnloadUnusedAssetsAsync(int loopCount = 10) returns an UnloadUnusedAssetsOperationRuntime/​ResourcePackage/​ResourcePackage.cs:355-361
UpdatePackageVersionOperation class (often confused with the real type)Does not existRequestPackageVersionOperation, with a .PackageVersion string propertyRuntime/​ResourcePackage/​ResourcePackage.cs:225-231
NetworkVariable<T> / OnValueChanged style sync for assets (leaked in from Netcode)Does not exist in YooAssetSubscribe AssetHandle.Completed event or await handle.Task / yield return handleRuntime/​ResourceManager/​Handle/​AssetHandle.cs:20-37, Runtime/​ResourceManager/​Handle/​HandleBase.cs:152-173
ResourceDownloaderOperation.OnDownloadFinishCallback (event-style)Field is a plain delegate, not an eventAssign once: downloader.DownloadFinishCallback = OnFinish; — do not += (single-slot field)Runtime/​ResourcePackage/​Operation/​DownloaderOperation.cs:86-101

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

More skills from gabrielmoreira

workflow-router logo
gabrielmoreira/agent-skills-mirror

workflow-router

研发工作流入口 - 帮助用户快速进入正确的工作流阶段。 触发关键词: 工作流, 流程, 从哪开始, 帮我, 我该怎么做, 下一步, workflow, 不知道用什么, 新手引导, 怎么用

19 0
View
平台架构知识 logo
gabrielmoreira/agent-skills-mirror

平台架构知识

Periodically refreshed mirror of agents, skills, prompts and instruction files from public repositories.

19 0
View
unity-profiler logo
gabrielmoreira/agent-skills-mirror

unity-profiler

Read-only Unity runtime performance snapshots — FPS, frame time, batches/draw calls, triangles/vertices, memory (total/mono/per-asset), object counts, AssetBundle stats. Exact signatures via GET /skills/schema.

19 0
View
ads-audit logo
gabrielmoreira/agent-skills-mirror

ads-audit

Full multi-platform paid advertising audit with parallel subagent delegation. Analyzes Google Ads, Meta Ads, LinkedIn Ads, TikTok Ads, Microsoft Ads, and Apple Ads accounts via 6 parallel audit agents. Amazon Ads, cross-platform attribution, and server-side tracking are covered by their standalon...

19 0
View
unity-skills logo
gabrielmoreira/agent-skills-mirror

unity-skills

Unity Editor automation via REST API — create scripts, analyze scenes, manage assets, control editor, orchestrate workflows, run batch jobs, and route by Unity version. Triggers: Unity, Unity Skills, in Unity, automate Unity, Unity editor automation, create Unity script, scene summary, analyze Un...

19 0
View
purple-cow-audit logo
gabrielmoreira/agent-skills-mirror

purple-cow-audit

Score product remarkability 1-10 to decide if it's worth promoting. Seth Godin's Purple Cow test. Triggers on: "is this product worth promoting", "should I promote", "product audit", "purple cow", "remarkable product", "is it remarkable", "rate this product", "product quality check", "worth my re...

19 0
View
unity-cleaner logo
gabrielmoreira/agent-skills-mirror

unity-cleaner

Project cleanup and audit — find unused assets, content-hash duplicates, missing references, empty folders, large assets, dependency trees; two-step confirm-token delete. Exact signatures via GET /skills/schema.

19 0
View
skill-manager-guide logo
gabrielmoreira/agent-skills-mirror

skill-manager-guide

**GUIDE SKILL** — Guide to the Skill Manager for Copilot extension. USE FOR: adding/removing skill repos, syncing skills, pushing feedback, configuring sync intervals, troubleshooting sync issues, understanding skill format. DO NOT USE FOR: creating new skills (use skill-creator), creating agents...

19 0
View
configure-nightwatch logo
gabrielmoreira/agent-skills-mirror

configure-nightwatch

Configures Laravel Nightwatch data collection, sampling rates, filtering rules, and redaction policies. Use when setting up Nightwatch, managing data volume, protecting sensitive data (PII), or optimizing event collection for production workloads.

19 0
View
research-and-write logo
gabrielmoreira/agent-skills-mirror

research-and-write

End-to-end workflow: research a topic and then write a LinkedIn post about it. Use this skill whenever the user wants the full pipeline — from a topic idea to a finished LinkedIn post. Triggers on: 'research and write a post about', 'create a LinkedIn post about [topic]', 'I want to post about', ...

19 0
View
AI Tutor Persona logo
gabrielmoreira/agent-skills-mirror

AI Tutor Persona

Periodically refreshed mirror of agents, skills, prompts and instruction files from public repositories.

19 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View