ui
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDetermine the appropriate UI system for the project and route to the correct specialized skill.
确定项目适用的UI系统,并将需求路由至对应的专业技能模块。
When to Route vs Answer Directly
何时路由 vs 直接回答
Route to a specialized skill when:
- User wants to understand, edit, or generate specific UI elements
- User references specific files or UI objects
- User asks for UI changes or creation
Answer directly (without routing) when:
- User asks comparative/educational questions ("What's the difference between UI Toolkit and uGUI?")
- User asks about UI system capabilities or recommendations ("Should I use UITK or uGUI for mobile?")
- User needs conceptual explanation of Unity UI architecture
需路由至专业技能模块的情况:
- 用户希望理解、编辑或生成特定UI元素
- 用户提及特定文件或UI对象
- 用户要求进行UI修改或创建
直接回答(无需路由)的情况:
- 用户提出对比/知识性问题(如“UI Toolkit和uGUI有什么区别?”)
- 用户询问UI系统的能力或选型建议(如“移动端应该用UITK还是uGUI?”)
- 用户需要Unity UI架构的概念性解释
Routing Logic
路由逻辑
Step 1: Check for explicit file references or keywords:
| User mentions | Route to |
|---|---|
| |
| "UI Toolkit", "UITK", "UIElements", "CreateGUI" | |
Canvas prefabs/objects, | |
| "uGUI", "Canvas", "RectTransform", "legacy UI" | |
| "IMGUI", "OnGUI", "OnInspectorGUI", "immediate mode" | |
Figma URL ( | Not available — see below |
For editor-related requests (EditorWindow, custom inspector, PropertyDrawer):
- If no explicit UI system mentioned → Go to Step 2 to detect project's editor UI system
- If no existing pattern is detected, default to for new editor UI
ui-uitk - Only use if project exclusively uses IMGUI or user explicitly requests it
ui-imgui
If explicit file or keywords found, activate the corresponding skill immediately.
Step 2: If ambiguous, detect from project:
Search the project to determine which UI system is in use:
| Look for | Indicates |
|---|---|
| UI Toolkit (runtime or editor) |
| UI Toolkit (runtime) |
Editor scripts with | UI Toolkit (editor) |
| uGUI |
| uGUI |
Editor scripts with | IMGUI (legacy editor) |
Step 3: If still unclear, ask or default:
- For existing projects: detect and follow whichever framework is already in use (Step 2)
- For new projects with no UI yet: ask the user which framework they prefer (UI Toolkit vs uGUI), briefly explaining that UI Toolkit is modern/CSS-like while uGUI is Canvas-based/mature
- For new runtime/game UI where the user has no preference: default to uGUI ()
ui-ugui - When the user mentions mobile/performance constraints or older Unity versions (pre-6.0): bias toward uGUI ()
ui-ugui
步骤1:检查是否有明确的文件引用或关键词:
| 用户提及内容 | 路由至 |
|---|---|
| |
| "UI Toolkit"、"UITK"、"UIElements"、"CreateGUI" | |
Canvas预制件/对象、包含UI的 | |
| "uGUI"、"Canvas"、"RectTransform"、"legacy UI" | |
| "IMGUI"、"OnGUI"、"OnInspectorGUI"、"immediate mode" | |
Figma链接( | 暂不支持——见下文说明 |
针对编辑器相关请求(EditorWindow、自定义检视面板、PropertyDrawer):
- 若未明确提及UI系统 → 进入步骤2,检测项目的编辑器UI系统
- 若未检测到现有模式,新编辑器UI默认使用
ui-uitk - 仅当项目完全使用IMGUI或用户明确要求时,才使用
ui-imgui
若检测到明确的文件或关键词,立即激活对应的技能模块。
步骤2:若存在歧义,从项目中检测:
搜索项目以确定正在使用的UI系统:
| 查找内容 | 对应系统 |
|---|---|
| UI Toolkit(运行时或编辑器) |
场景中的 | UI Toolkit(运行时) |
包含 | UI Toolkit(编辑器) |
场景/预制件中的 | uGUI |
大量使用 | uGUI |
包含 | IMGUI(旧版编辑器) |
步骤3:若仍不明确,询问用户或使用默认值:
- 对于现有项目:遵循步骤2中检测到的已使用框架
- 对于尚未搭建UI的新项目:询问用户偏好的框架(UI Toolkit vs uGUI),并简要说明UI Toolkit是现代类CSS风格,而uGUI是基于Canvas的成熟系统
- 对于用户无偏好的新运行时/游戏UI:默认使用uGUI()
ui-ugui - 当用户提及移动端/性能限制或旧版本Unity(6.0之前):优先选择uGUI()
ui-ugui
Request Types
请求类型
Specialized skills handle three types of requests:
| Type | Examples |
|---|---|
| Understanding | "What does this button do?", "How is this laid out?", "Explain this UI" |
| Editing | "Change this color", "Add a label here", "Fix this layout" |
| Generation | "Create a menu", "Make an inventory screen", "Build a settings panel" |
Route all types to the appropriate specialized skill based on the UI system.
专业技能模块处理三类请求:
| 类型 | 示例 |
|---|---|
| 理解类 | “这个按钮的功能是什么?”、“这个布局是如何实现的?”、“解释这个UI的结构” |
| 编辑类 | “修改这个颜色”、“在这里添加一个标签”、“修复这个布局问题” |
| 生成类 | “创建一个菜单”、“制作一个 inventory 界面”、“搭建一个设置面板” |
根据UI系统将所有类型的请求路由至对应的专业技能模块。
Available Sub-Skills
可用子技能模块
UI Toolkit — ui-uitk
ui-uitkUI Toolkit — ui-uitk
ui-uitk- For Unity 6.0+ projects using UI Toolkit (runtime game UI and editor tools)
- Understands, edits, and generates and
.uxmlfiles.uss - Modern, CSS-like styling approach
- Preferred for new editor windows (CreateGUI) and existing UI Toolkit projects
- 适用于使用UI Toolkit的Unity 6.0+项目(运行时游戏UI和编辑器工具)
- 支持理解、编辑和生成和
.uxml文件.uss - 采用现代类CSS的样式设计方式
- 是新编辑器窗口(CreateGUI)和现有UI Toolkit项目的首选方案
uGUI — ui-ugui
ui-uguiuGUI — ui-ugui
ui-ugui- For projects using Unity's Canvas-based UI system
- Understands, edits, and generates Canvas hierarchies
- Uses Layout Groups for responsive design
- Default for new runtime/game UI when the user has no framework preference
- 适用于使用Unity基于Canvas的UI系统的项目
- 支持理解、编辑和生成Canvas层级结构
- 使用Layout Groups实现响应式设计
- 当用户无框架偏好时,是新运行时/游戏UI的默认选择
IMGUI — ui-imgui
ui-imguiIMGUI — ui-imgui
ui-imgui- For legacy editor tools using OnGUI/immediate mode
- Only use when project has existing IMGUI editor code or user explicitly requests IMGUI
- Understands, edits, and generates EditorWindow, inspectors, PropertyDrawers built with OnGUI
- Not for runtime game UI — for new editor tools, use UI Toolkit unless the project already uses IMGUI exclusively
- 适用于使用OnGUI/即时模式的旧版编辑器工具
- 仅当项目已有IMGUI编辑器代码或用户明确要求时使用
- 支持理解、编辑和生成基于OnGUI的EditorWindow、检视面板、PropertyDrawers
- 不适用于运行时游戏UI——对于新编辑器工具,除非项目完全使用IMGUI,否则优先使用UI Toolkit
Figma design import — not available here
Figma设计导入 — 暂不支持
Importing a Figma design requires Unity's Figma integration service, which only exists
inside Unity AI Assistant. There is no client-side equivalent, so do not promise it.
If the user brings a Figma URL, say the automated import is not available here and offer
the alternative: ask them to describe or screenshot the screen, then build it with the
appropriate framework skill above.
导入Figma设计需要Unity的Figma集成服务,该服务仅在Unity AI Assistant中提供,目前无客户端等效功能,因此请勿承诺支持。
若用户提供Figma链接,请告知此处不支持自动导入,并提供替代方案:请用户描述或截图界面,再使用上述合适的框架技能模块进行搭建。
Common Guidelines (All UI Systems)
通用准则(所有UI系统)
Scope Discipline
范围规范
Do only what is requested:
- Question → answer without making changes
- Targeted edit → modify only what's specified
- Generation → create only requested files
- Don't proactively add scripts unless explicitly asked
These do NOT imply scripts:
- "proper buttons" → well-styled buttons
- "working UI" → valid UI that renders
- "menu screen" → visual layout only
仅执行请求内容:
- 问题 → 直接回答,不进行修改
- 针对性编辑 → 仅修改指定内容
- 生成请求 → 仅创建所需文件
- 除非明确要求,否则不要主动添加脚本
以下表述不意味着需要添加脚本:
- “功能完善的按钮” → 样式美观的按钮
- “可运行的UI” → 能正常渲染的有效UI
- “菜单界面” → 仅视觉布局
Conventions
约定
Follow project patterns first. Search existing files before applying defaults.
| Type | Convention |
|---|---|
| Element names | Follow project patterns, or camelCase |
| File organization | Match existing project structure |
优先遵循项目现有模式。在应用默认规则前,先搜索现有文件。
| 类型 | 约定 |
|---|---|
| 元素命名 | 遵循项目现有模式,或使用小驼峰命名法 |
| 文件组织 | 匹配现有项目结构 |
Workflow
工作流程
- Determine UI system — Use routing logic above
- For Figma requests, tell the user the automated import is not available here, then work from their description or screenshot and continue with framework detection
- Activate specialized skill — Route to ,
ui-uitk, orui-uguiui-imgui - Skill handles request — Understanding, editing, or generation as appropriate
- 确定UI系统 — 使用上述路由逻辑
- 对于Figma请求,告知用户此处不支持自动导入,然后根据用户的描述或截图继续进行框架检测
- 激活专业技能模块 — 路由至、
ui-uitk或ui-uguiui-imgui - 技能模块处理请求 — 根据需求进行理解、编辑或生成操作
Handling Mixed Projects
混合项目处理
Many Unity projects use multiple UI systems simultaneously (e.g., UI Toolkit for runtime game UI plus editor tools). When you detect multiple systems:
- For runtime UI requests (menus, HUDs, game screens) → Route to whichever runtime system (UITK or uGUI) is already in use
- For editor tool requests (custom inspectors, editor windows):
- Prefer UI Toolkit (CreateGUI) for new editor UI — it's the modern approach
- Only use IMGUI if the project's existing editor tools use IMGUI exclusively, or user explicitly requests IMGUI
- Check for existing editor files to confirm UITK usage
.uxml
- If creating new runtime UI in a mixed project → Match the pattern used by similar existing UI; if there is no similar existing UI and the user has no preference, use uGUI
许多Unity项目会同时使用多种UI系统(例如,运行时游戏UI使用UI Toolkit,编辑器工具使用其他系统)。当检测到多种系统时:
- 对于运行时UI请求(菜单、HUD、游戏界面) → 路由至已在使用的运行时系统(UITK或uGUI)
- 对于编辑器工具请求(自定义检视面板、编辑器窗口):
- 优先选择UI Toolkit(CreateGUI)开发新编辑器UI——这是现代化方案
- 仅当项目现有编辑器工具完全使用IMGUI,或用户明确要求时,才使用IMGUI
- 检查现有编辑器文件以确认是否使用UITK
.uxml
- 在混合项目中创建新运行时UI → 匹配现有同类UI的模式;若没有同类现有UI且用户无偏好,则使用uGUI