基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Besty0728/Unity-Skills --skill unity-patterns命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Automate the Unity Editor through a local REST API — create and edit scripts, build scenes and prefabs, manage assets/materials/lighting, run tests, and drive hundreds of Editor operations across modules. Use when the user wants to actually operate the Unity Editor from chat — create or modify GameObjects/scripts/scenes/assets, batch-edit, or run Editor automation — in any language. Not needed for conceptual Unity Q&A that touches no Editor state — read the matching advisory doc under skills/ instead. 当用户要从对话里实际操作 Unity 编辑器(创建/修改/批量编辑/运行测试)时使用,任何语言均可触发;纯概念问答无需本协议。
Unified batch and async-job orchestration
Index of all Unity Skills modules with per-module mode labels (SA/FA/Mixed). Use to find which module covers a task before loading its doc.
| name | unity-patterns |
| description | Advise on choosing Unity design patterns |
Before calling any skill in this module: if you are about to call a skill with parameters guessed from its name or description, STOP — read this file (or fetch its schema via
GET /skills/recommend?includeSchema=true) first. If you already have the parameter definitions from recommend/schema, you may proceed straight to dryRun.
Use this skill to decide whether a pattern is justified. Do not recommend every pattern at once.
Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).
ScriptableObject
C# events / delegates
Global event bus / observer hub
Interfaces
State machine
Object pool
Service layer
Generics / custom attributes
The Pattern Guide above answers "which pattern?". For most non-trivial design decisions, the better exercise is: pick the 2-3 plausible implementations, put them side by side, and compare on switch cost, query cost, code complexity, and failure modes. Below is a worked example; use it as the shape for other decisions rather than as the answer.
| Implementation | Switch cost (enter/exit cutscene) | Per-frame cost while paused | Code complexity | Failure modes |
|---|---|---|---|---|
Field flag: each EnemyAI.Update starts with if (_paused) return;; manager sets the flag | O(N) writes, no allocations | N branch tests + dispatch overhead per frame | Lowest — one bool, one guard clause | Silent bugs when a dev adds a new Update and forgets the guard |
enabled = false: manager disables the MonoBehaviour on every enemy | O(N) writes, no allocations | Zero — Unity skips disabled Behaviours in its message list | Low, but state spread across components | OnDisable / OnEnable side effects (coroutines stop, listeners unsubscribe) may fire unexpectedly |
Subset list: manager keeps _active / _frozen lists; no per-enemy Update — manager ticks only _active | O(N) list move on switch | Proportional to _active count only — perfect early-cull | Highest — one source of truth for ownership, requires managed ticking | Adding a new Update on enemies reintroduces per-frame cost; the list is easy to desync if other code respawns enemies directly |
Dots101/Entities101/Assets/HelloCube/13. StateChange/SetStateSystem.cs:42-80 — one system dispatches to three implementations behind config.Mode, each with measurably different cost in the profiler.If one option is obviously bounded (N ≤ 10, state changes once per session, or the code runs once at startup), a single paragraph "we picked X because it's simplest" is enough. Decision Lab is for choices that will outlive the current task.