ui-flow

Guides building Unity screens, menus, and HUD with prefabs, focus navigation, and event-driven updates.

Updated Apr 27, 2024
One-click install
npx skills add https://github.com/IgorGribowsky/rts-sandbox --skill ui-flow-igorgribowsky
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ui-flow
Source: https://github.com/IgorGribowsky/rts-sandbox/tree/main/rts-sandbox-src/.claude/skills/ui-flow
Command: npx skills add https://github.com/IgorGribowsky/rts-sandbox --skill ui-flow-igorgribowsky

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Game UI work often breaks down into screens that open on top of each other, interfaces that only work with a mouse, HUDs that poll values every frame, and layouts that fall apart at different aspect ratios. This Skill provides a consistent architecture for screens, menus, HUD, and transitions in Unity so these problems are prevented by design rather than patched later. ## Core Features & Use Cases - Screen architecture: One prefab per screen, explicit game states (title, game, pause, death), and transitions managed in a single place so two screens never open simultaneously. - Scaling and layout: Canvas Scaler configuration, anchor-based positioning, safe-area margins, and TextMeshPro fonts so the interface holds up across resolutions. - Focus and input: Explicit focus on screen open, defined navigation between elements, working back navigation, and input scheme switching between gameplay and menus. - Event-driven HUD: HUD subscribes to change events instead of polling in Update, with mandatory unsubscription and smoothing for fast-changing values. - Use Case: When adding a pause menu to a Unity game, apply this Skill to wire the pause state, freeze game time without freezing menu animations, set focus on the resume button, and restore the exact previous time scale on exit. ## Quick Start Apply the ui-flow skill to review or build the pause menu and HUD for my Unity game, checking state transitions, focus, and event-driven updates.

Frequently Asked Questions about ui-flow

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure screens and menus in a Unity game?

Build each screen as its own prefab rather than constructing UI in code, and let a central game-state manager open and close screens. Define states explicitly (title, game, pause, death) with transitions in one place so two screens never open at once.

How do I update a Unity HUD without polling every frame?

Use event-driven updates: the owner of a value like health or score raises an event when it changes, and the HUD subscribes and redraws only what changed. Always unsubscribe when the object is disabled to avoid double updates and dead references after restart.

Why does my Unity UI break at different screen resolutions?

This happens when elements are positioned in raw pixels or the Canvas Scaler is not configured. Use Scale With Screen Size mode with a reference resolution, anchor elements to their logical edges, keep margins for safe areas, and use TextMeshPro fonts.

How do I make a Unity menu work with keyboard or controller?

Set focus explicitly on a specific element when the screen opens, define navigation transitions between elements manually if automatic ones misbehave, and ensure back navigation works on every screen. Switch input schemes when entering and exiting menus so gameplay actions do not fire.

Why does my pause menu freeze along with the game?

The menu animations and sounds are tied to game time, which is stopped during pause. Drive UI animations and menu audio with unscaled time, and on unpause restore the exact previous time scale rather than resetting it to one.