一键导入
unity-pattern-object-pooling
Object Pooling
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Object Pooling
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Lazy-load for LUX Unity bridge and MCP game-development operations: status, compile, tests, logs, launch, screenshots, hierarchy, dynamic code, record/replay, and one-loop MCP workflows.
Lazy-load only when this workflow is explicitly needed. Use for durable technical choices. Output a short ADR: Context, Decision, Alternatives, Consequences, Verification, Owner. Prefer existing LUX boundaries: gateway owns CLI/server, bridge owns Unity protocol, Skills owns passive workflows. Reject duplicate state, hidden fallback, and broad rewrites without evidence.
Lazy-load only when this workflow is explicitly needed. Use to review an existing design or implementation for boundary drift. Check SSoT, responsibility split, protocol consistency, atomicity, idempotency, and observable failures. Return ranked findings with file references, risk level, and the smallest corrective action.
Lazy-load only when this workflow is explicitly needed. Use when a change risks architectural drift. Enforce: .lux is SSoT; clear subsystem ownership; consistent schemas; atomic operations; idempotent retries; no silent fallback. Report violations and concrete repair steps.
Lazy-load only when this workflow is explicitly needed. Use for high-risk product, automation, or ethical decisions. Run: clarify intent; quantify evidence; check user/data/IP/fairness risks; define stop and rollback conditions; record approval. Verdicts: PASS, REVIEW, or REJECT.
Lazy-load only when this workflow is explicitly needed. Use to turn observed failures into actionable reports. Capture summary, environment, exact steps, expected result, actual result, logs, suspected subsystem, severity, reproducibility, and minimal next diagnostic. Do not invent fallback data.
| name | unity-pattern-object-pooling |
| description | Object Pooling |
| category | unity |
| source | unity-design-patterns-skills |
| source_path | patterns/object-pooling/SKILL.md |
Reuse expensive or high-churn objects instead of allocating and destroying them repeatedly.
public sealed class BulletPool
{
private readonly Queue<Bullet> _free = new();
public Bullet Get() => _free.Count > 0 ? _free.Dequeue() : new Bullet();
public void Release(Bullet bullet)
{
bullet.ResetState();
_free.Enqueue(bullet);
}
}