This document provides a high-level introduction to the YooAsset resource management system for Unity3D. It covers the overall architecture, major subsystems, and how they interact to provide build-time asset bundling and runtime asset loading capabilities.
For specific information about:
YooAsset is a comprehensive asset bundle management framework for Unity3D that handles the complete lifecycle of game assets from build-time collection and packaging to runtime loading and memory management. The system is production-ready, having been validated in commercial games with millions of daily active users.
The framework addresses key requirements for modern game development:
Sources: README.md1-72 Assets/YooAsset/CHANGELOG.md1-72
YooAsset consists of three primary subsystems that operate at different phases of the game development lifecycle:
Sources: High-level system diagrams (Diagram 1, Diagram 2)
The YooAssets static class serves as the primary entry point for all runtime operations. It manages global initialization, package creation, and system-wide configuration. Individual resource packages are represented by ResourcePackage instances, which encapsulate a collection of assets with their own manifest and file systems.
Key classes:
YooAssets - Static facade providing system initialization and package managementResourcePackage - Represents a single asset package with its own resources and configurationFor detailed API documentation, see YooAssets Static API and System Initialization and Resource Packages and Play Modes.
Sources: High-level system diagrams (Diagram 1)
The build-time systems execute only in the Unity Editor and are responsible for collecting assets, analyzing dependencies, and producing asset bundles along with metadata.
Key components:
PackageManifest files in multiple formats (JSON for debugging, binary for runtime, hash files for verification)The build process is highly configurable through BuildParameters and supports features like encryption, compression, and custom naming conventions.
For detailed build system documentation, see Asset Bundle Build System.
Sources: High-level system diagrams (Diagram 1, Diagram 2)
The runtime systems manage asset loading, caching, downloading, and memory lifecycle during game execution.
Key components:
IFileSystem interfaceThe runtime architecture supports five operational modes:
For detailed runtime documentation, see Core Runtime Architecture.
Sources: High-level system diagrams (Diagram 1, Diagram 3)
The file system layer provides a unified interface (IFileSystem) with multiple implementations:
| Implementation | Purpose | Primary Use Case |
|---|---|---|
DefaultEditorFileSystem | Editor simulation using AssetDatabase | Development/testing without builds |
DefaultBuiltinFileSystem | StreamingAssets access | Read-only resources in the installation package |
DefaultCacheFileSystem | Downloaded bundle management | Remote assets with caching and verification |
DefaultWebServerFileSystem | Direct web loading | WebGL same-origin deployments |
DefaultWebRemoteFileSystem | Cross-domain web loading | WebGL cross-domain scenarios |
WechatFileSystem | WeChat Mini Game platform | WeChat-specific file handling |
TiktokFileSystem | TikTok Mini Game platform | TikTok-specific file handling |
GooglePlayFileSystem | Google Play Asset Delivery | Android dynamic feature delivery |
Each file system handles bundle loading, verification, and platform-specific concerns. The cache file system includes sophisticated download management with concurrent downloads, resume support, and integrity verification.
For detailed file system documentation, see File System Architecture.
Sources: High-level system diagrams (Diagram 4), Assets/YooAsset/CHANGELOG.md219-221 Assets/YooAsset/CHANGELOG.md312-317
The following diagram illustrates how data flows from editor-time configuration through the build process to runtime consumption:
The data transformation pipeline:
YooAssetSettings and CollectorSettings define global settings and asset collection rulesCollectResult contains all assets matching the configured rules with metadataBuildMapContext assigns bundle names, resolves dependencies, and applies packing rulesPackageManifest is serialized in multiple formats containing all asset and bundle metadataResourcePackage loads manifests and creates AssetInfo and BundleInfo objects for queriesSources: High-level system diagrams (Diagram 2, Diagram 5)
The runtime lifecycle follows this sequence:
Key initialization parameters determine the operational mode:
EditorSimulateModeParameters - For editor simulationOfflinePlayModeParameters - For offline/standalone gamesHostPlayModeParameters - For online games with updatesWebPlayModeParameters - For WebGL deploymentsCustomPlayModeParameters - For custom file system configurationsSources: High-level system diagrams (Diagram 3), Assets/YooAsset/CHANGELOG.md634-648
All asynchronous operations in YooAsset are managed by the OperationSystem, which provides:
AsyncOperationBase with consistent status, progress, and completion callbacksCommon operation types:
InitializeOperation - Package initializationUpdatePackageVersionOperation - Version checkingUpdatePackageManifestOperation - Manifest updatesResourceDownloaderOperation - Multi-file downloadsAssetHandle, SceneHandle, RawFileHandle)UnloadSceneOperation - Scene cleanupSources: High-level system diagrams (Diagram 1, Diagram 5), Assets/YooAsset/CHANGELOG.md277-292
YooAsset provides pluggable service interfaces for customization without modifying core code:
| Interface | Purpose | Configuration Phase |
|---|---|---|
IEncryptionServices | Bundle encryption at build time | Build parameters |
IDecryptionServices | Bundle decryption at runtime | File system parameters |
IManifestProcessServices | Manifest compression/encryption | Build parameters |
IManifestRestoreServices | Manifest decompression/decryption | Runtime parameters |
IRemoteServices | Custom CDN URL resolution | File system parameters |
ICopyLocalFileServices | Custom file copy logic | File system parameters |
These interfaces enable scenarios like:
For implementation examples, see Service Interfaces and Extension Points and Custom Service Implementation Examples.
Sources: High-level system diagrams (Diagram 4, Diagram 5), Assets/YooAsset/CHANGELOG.md376-408
YooAsset is distributed as a Unity package with the following structure:
YooAsset.Runtime.dll) - Core runtime systems, no editor dependenciesYooAsset.Editor.dll) - Build systems, collector windows, analysis toolsThe system integrates with Unity's build pipeline and supports Unity versions 2019.4 and newer. Platform support includes Windows, macOS, Linux, iOS, Android, WebGL, and console platforms.
For detailed package structure and installation instructions, see Package Structure and Unity Integration.
Sources: README.md1-72 Assets/YooAsset/CHANGELOG.md1-50
YooAsset uses semantic versioning. The current major version (2.x) represents a significant architecture evolution from 1.x with the introduction of the file system abstraction layer. The manifest format has also evolved, with version 2.2.5+ manifests incompatible with older runtime versions.
Key version features:
For migration guidance between versions, see Migration Guide.
Sources: Assets/YooAsset/CHANGELOG.md5-1130 Assets/YooAsset/CHANGELOG.md196-198
YooAsset provides a complete asset management solution for Unity with:
The architecture cleanly separates build-time and runtime concerns while maintaining data flow through the PackageManifest as the central contract between these phases.
Sources: README.md1-72 High-level system diagrams (All diagrams)
Refresh this wiki