asset-module

Load and instantiate cached Unity Addressables assets with release tracking.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/punkfuncgames/tetris-clone --skill asset-module
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: asset-module
Source: https://github.com/punkfuncgames/tetris-clone/tree/main/.claude/skills/asset-module
Command: npx skills add https://github.com/punkfuncgames/tetris-clone --skill asset-module

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about asset-module

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I cache Unity Addressables AsyncOperationHandle results to prevent duplicate downloads?

Cache Unity Addressables AsyncOperationHandle results by loading assets through a centralized service that stores handles internally. This prevents duplicate downloads and redundant handles by returning cached references for subsequent load requests by address or AssetReference.

How do I track instantiated prefabs in Unity Addressables for proper ReleaseInstance calls?

Track instantiated prefabs in Unity Addressables by using a managed instantiation system that records each GameObject separately. This separates ReleaseInstance calls for GameObjects from Release calls for assets, ensuring proper memory cleanup and preventing leaks.

Can I preload Unity Addressables by label with download progress reporting for loading screens?

Preload Unity Addressables by label by downloading dependencies before loading and exposing progress callbacks. This approach manages entire asset groups upfront, allowing you to drive loading screen UI while dependencies download in the background.

Does this asset loading approach support dependency injection in Unity runtime workflows?

This asset loading approach supports dependency injection by exposing an IAssetService interface. It registers as a singleton, allowing gameplay systems and tooling to consume cached addressable loading and instantiation functionality without hard dependencies.

What is the best way to unload unused assets and run garbage collection in Unity Addressables?

Unload unused assets and run garbage collection in Unity Addressables by centralizing cleanup through a managed service. This ensures controlled release of handles and instances, unloading resources only when appropriate to avoid memory leaks and inefficient load patterns.

Why does my Unity Addressables project experience memory leaks when instantiating prefabs?

Unity Addressables projects experience memory leaks when instantiated prefabs are not tracked separately from loaded assets. Using a managed instantiation service ensures proper ReleaseInstance semantics, tracking GameObjects to guarantee correct cleanup and release.