AGENT SKILL

unity-build-ui

Implement Unity game UI with an explicit uGUI or UI Toolkit selection, player focus ownership, and reliable HUD state.

License 许可
MIT
最近更新
2026-11-13
Stars
★ 4
Forks
3

01 前言 Front Matter

name
unity-build-ui
engines
[ "UNITY" ]
description
Implement Unity game UI with an explicit uGUI or UI Toolkit selection, player focus ownership, and reliable HUD state.

02 资源文件 2

03 SKILL.md 正文

Unity Build UI

When to use

Implement Unity game UI with an explicit uGUI or UI Toolkit selection, player focus ownership, and reliable HUD state. Use this feature only for Unity-owned project code and assets.

Activation and prerequisites

Run commands/resolve-engine.sh and commands/resolve-skill.sh unity-build-ui before edits or tool launches. Continue only when the effective engine is UNITY and this skill is eligible. A requested skill never selects its engine. Honor the resolved task override evidence and permitted output scope when an isolated prototype is selected.

Record Unity version, target player surfaces, selected uGUI or UI Toolkit runtime stack, input backend, local player count, safe areas, localization and accessibility requirements. Confirm any UI packages and their supported runtime controls. Inspect existing screens and font assets before changes; preserve serialized references and unrelated listeners.

Workflow

  1. Select the existing UI stack explicitly. For uGUI, use Canvas, RectTransform, layout components, EventSystem and the chosen input module; for UI Toolkit, use UIDocument, VisualElement, UXML/USS and the version-supported event/focus APIs.
  2. Define screen lifecycle, stack order, pause behavior and one input owner per local player. A modal must capture the intended actions, block gameplay leakage and restore valid prior focus after closing.
  3. Build responsive hierarchy for aspect changes, safe areas, text expansion and scale preferences. Keep world-space UI and screen-space readability budgets distinct; prevent transparent hit targets from stealing input unexpectedly.
  4. Implement keyboard/controller navigation and pointer interaction together. Use EventSystem selection or UI Toolkit focus deliberately; rebuild focus when elements disappear, become disabled or are virtualized.
  5. Initialize HUD from an authoritative snapshot, subscribe to changes once and unsubscribe on screen teardown. Handle player possession, respawn and scene reload without stale references or double event delivery.
  6. Generate binding-aware prompts from the paired player's active control scheme. Treat settings as validated data and keep reduced motion, text scale and haptic intensity independent.
  7. Provide accessible structure and nonvisual cue alternatives supported by the target platform. Do not infer native screen-reader behavior from a browser accessibility tree or Editor-only preview.

Read stack, font and rebuild decisions when selecting bindings, text rendering or optimizing UI updates. Use a localization owner for table/locale lifetimes while this workflow retains screen and focus ownership.

Verification

  • Test modal nesting, cancel/back, focus restoration, pointer-to-controller switching and two-player input isolation.
  • Test narrow/wide layouts, safe areas, long localized text, scale changes, empty/loading/error states and HUD open-close-respawn cycles.
  • Measure layout/rebuild, batching and text-atlas costs in the chosen stack; include repeated screen reuse and unchanged HUD data. Avoid rebuilding the entire interface to change one value.
  • Capture actual native/player evidence. Browser QA is appropriate for a Unity web build but cannot certify a native player's UI behavior.

Output

Selected-stack UI assets and adapters, screen/focus ownership map, HUD binding lifecycle, layout matrix and target-specific interaction evidence. Record environment, expected and observed results, evidence paths, and blocked or not-run checks separately from passes.

Boundaries

Do not mix uGUI and UI Toolkit without a documented event/input bridge. Missing native accessibility or device tests remain explicitly blocked or not run. Engine guidance applies to engine-owned code; independent services retain their architecture contracts.

References

04 同仓库更多 Skills

TimothyMeadows
TimothyMeadows/Hephaera

verify-web3-game-lifecycle

Verify a game's selected Web3 asset, wallet, ownership and trading lifecycle with contract properties, canonical recovery, actual target evidence and separate release readiness.

★ 4
TimothyMeadows
TimothyMeadows/Hephaera

verify-onchain-game-assets

Verify exact on-chain game collection ownership and quantities at canonical blocks, reconcile inventory events, and design honest match admission. Use for ERC721/ERC1155 inventory, reorg recovery, reservations, or transfer-during-match rules.

★ 4
TimothyMeadows
TimothyMeadows/Hephaera

plan-web3-game-assets

Define an opt-in Ethereum, Base or Immutable game-asset lifecycle, including token identity, supply, rights, custody, game eligibility and chain-specific dependencies.

★ 4
TimothyMeadows
TimothyMeadows/Hephaera

integrate-game-wallets

Integrate explicit player-wallet connection, scoped SIWE authentication, authority invalidation and reviewed target-specific handoff without application-held player keys.

★ 4
TimothyMeadows
TimothyMeadows/Hephaera

integrate-game-asset-trading

Integrate explicitly selected game asset settlement with exact unsigned intents, scoped approvals, idempotent operations and canonical receipt reconciliation. Use for NFT listing, buying, cancellation, retries or marketplace integration.

★ 4
TimothyMeadows
TimothyMeadows/Hephaera

build-evm-game-contracts

Author and verify host-owned EVM game collections and explicit mint, burn, craft or admin rules with pinned Solidity tooling. Use for contract source and deployment candidates; deployment and player signing require separate authorization.

★ 4