com.xmobitea.changx.mini-poolmanager
v1.5.2
Published
Scene-authored GameObject pooling utility for Unity.
Readme
XmobiTea PoolManager
Small scene-authored pooling utility for Unity GameObject prefabs.
AI Docs
| Need | Use |
| --- | --- |
| Generate spawn/despawn code | AI_USAGE.md |
| Scene and prefab setup | AI_SETUP.md |
| Copyable usage skeletons | AI_PATTERNS.md |
| Exact signatures and logs | AI_API_REFERENCE.md |
| Runtime behavior and edge cases | AI_BEHAVIOR.md |
| Package guardrails | AGENTS.md |
Contract
- Namespace:
XmobiTea.MiniPoolManager - Main class:
PoolManager : Singleton<PoolManager> - Scene host auto-created: No
- Pool contract:
IPoolItem - Base component:
PoolItem - Pool key:
IPoolItem.poolName - Component lookup scope: root
GameObjectonly viaGetComponent<IPoolItem>() - Delayed despawn scene host:
XmobiTea.MiniGlobalCoroutine.GlobalCoroutineonly for finite positivetimeToLivevalues
Minimal Setup
- Add
PoolManagerto an active object in a loaded scene. - Add
GlobalCoroutineonly if using finite positive delayed despawn. - Add
PoolItemor a customIPoolItemcomponent to each pooled prefab rootGameObject. - Optionally set
_poolName. IfPoolItem._poolNameis blank or whitespace, the pool key falls back to the prefab name without Unity's(Clone)suffix.
Minimal Usage
using UnityEngine;
using XmobiTea.MiniPoolManager;
public sealed class ProjectilePoolItem : PoolItem
{
public override void OnSpawn()
{
}
public override void OnDespawn()
{
}
}var instance = PoolManager.Spawn(prefab, position, rotation);
if (instance != null)
{
PoolManager.Despawn(instance, 2f);
}Package Metadata
- Package name:
com.xmobitea.changx.mini-poolmanager - Runtime assembly:
com.xmobitea.changx.mini-poolmanager.runtime - Unity version:
2022.3 - License:
Apache-2.0
