ui_skill
- C#
44
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill besty0728/unity-skills --skill ui- SKILL.md6.3 KB
Overview
This skill creates Unity UI elements (Canvas, Panel, Button, Text, Image, InputField, Slider, Toggle) and supports efficient multi-element creation via a batch API. It auto-detects TextMeshPro and returns which text system was used. Use ui_create_* for single items and ui_create_batch for two or more elements to minimize calls and keep hierarchy consistent.
How this skill works
Each ui_create_* call instantiates a configured UI GameObject with sensible defaults (names, sizes, colors, positions) and optional parent assignment. ui_create_batch accepts an items array of element configs to create many objects in one call. The skill inspects the project for TextMeshPro; if present it creates TextMeshProUGUI objects and includes a usingTMP flag in responses.
When to use it
- Create a single UI element quickly (ui_create_button, ui_create_text, etc.).
- Build a menu, HUD, or dialog with multiple elements using ui_create_batch to reduce API calls.
- Initialize a Canvas or switch between ScreenSpace and WorldSpace rendering.
- Generate grouped UI under a Panel for layout and scripting access.
- Create runtime UI dynamically (settings panels, tooltips, in-game HUD).
Best practices
- Always create a Canvas before other UI elements to ensure correct rendering.
- Use ui_create_batch whenever creating two or more elements to improve performance and keep hierarchy changes atomic.
- Assign meaningful names and set parent to simplify Find and runtime scripting.
- Use Panels to group related elements and control layout or visibility.
- Prefer WorldSpace Canvas for 3D UI like floating health bars.
Example use cases
- Build a main menu: create a Canvas, then use ui_create_batch to add a panel and multiple buttons (Start, Options, Quit).
- Spawn an in-game HUD: batch-create health bar (Image), score text, and minimap panel at runtime.
- Quickly add a settings section: create toggles, sliders, and input fields grouped under a Panel.
- Convert legacy projects: detect TextMeshPro and create TMP text objects automatically when available.
- Prototype UI layouts in code without manually creating GameObjects in the editor.
FAQ
The skill checks for TextMeshPro in the project. If found it creates TextMeshProUGUI elements; otherwise it falls back to UnityEngine.UI.Text and reports usingTMP in the response.
When should I always use ui_create_batch?
Use ui_create_batch whenever you need to create two or more UI elements in the same operation. It reduces the number of API calls, preserves intended hierarchy, and is faster for grouped UI creation.