What problem does it solve?
The AssetModule solves runtime asset management complexity by providing cached Addressables loading, tracked instantiation, and controlled release to prevent duplicate downloads, memory leaks, and inefficient load patterns in Unity projects. It centralizes downloading, preloading, and cleanup so gameplay systems can request resources without duplicating logic or mishandling lifecycles.
Core Features & Use Cases
- Cached loading: Load assets by address or AssetReference with caching to avoid repeated downloads and redundant handles.
- Instantiation tracking & release: Instantiate prefabs and track instances separately to ensure proper ReleaseInstance and Release semantics.
- Preloading with progress: Preload asset groups by label with download dependency management and progress callbacks for loading screens.
- Cleanup & integration: Unload unused assets and run GC when appropriate; registers as a singleton IAssetService for dependency injection and easy consumption across systems.
Quick Start
Load and instantiate the EnemyPrefab using the AssetModule with caching, show preload progress for the GameplayAssets label, and release the instance and asset when finished.