pool-module

Manage Unity object pools with DI integration and lifecycle hooks.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PoolModule addresses the cost of frequent GameObject creation and destruction in Unity by providing a high-performance, DI-enabled object pool. It minimises allocations, reduces GC pressure, and ensures deterministic reuse of objects.

Core Features & Use Cases

  • Deterministic O(1) returns and reuse of pooled objects
  • DI integration via VContainer to wire services
  • Event-driven lifecycle notifications using MessagePipe
  • Async preloading to warm up pools
  • IPoolable hooks for custom lifecycle behavior on get/return

Quick Start

Create a pool for a prefab and start requesting and returning objects as gameplay requires.

Frequently Asked Questions about pool-module

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

FAQPage Schema
How do I reduce garbage collection overhead from frequent GameObject creation and destruction in Unity?

Object pooling in Unity minimizes garbage collection overhead by reusing active objects instead of destroying them. This approach ensures deterministic O(1) returns and reduces memory allocation pressure during intense gameplay loops.

Can I use dependency injection to manage object lifecycles in a Unity game?

Yes, dependency injection can manage object lifecycles by wiring pool services directly into your architecture. This integration enables event-driven lifecycle notifications and custom behavior hooks when getting or returning pooled objects.

How do I preload Unity GameObjects asynchronously to prevent frame drops during gameplay?

Asynchronous preloading warms up object pools before gameplay begins, preventing runtime frame drops. By triggering PreloadAsync, you populate pools with necessary GameObjects ahead of time, ensuring smooth spawning when needed.

Does this Unity pooling solution support custom behavior when objects are spawned or despawned?

Yes, Unity pooling supports custom spawn and despawn behavior through IPoolable callbacks. These hooks allow pooled objects to execute specific event-driven logic whenever they are retrieved from or returned to the pool.

What is the best way to pool resources for high-frequency spawning in Unity simulations?

The best way to pool resources for high-frequency spawning in Unity is using a high-performance, DI-enabled pool. It provides deterministic reuse, diagnostics, and event brokers to efficiently manage object lifecycles in demanding simulations.