Phase 6 updates

Phase 6 · Slice 21 ·

UI Toolkit (stage 1 of 3, for UnityChess)

  • UnityEngine.UIElements in the core module: VisualElement (hierarchy and content containers, classes, names, Q/Query and UQueryBuilder, enabled state, pseudo-states, schedule, layout, worldBound, contentRect, coordinate changes), the style types (Length, StyleLength, StyleFloat, StyleColor, StyleEnum, StyleBackground, StyleFont, StyleKeyword), IStyle inline values and IResolvedStyle.
  • USS: rules with type, #name, .class and :pseudo-state selectors, descendant and child combinators, specificity then order, @import, var() with inherited custom properties, inheritance (color, font, text), initial, the margin/padding/border/radius/flex shorthands, colors, url() and resource() images and fonts. UXML: elements by type (built-in, or a project's class by namespace), attributes onto properties, inline style, Style, Template/Instance with AttributeOverrides and content-container; VisualTreeAsset.Instantiate and CloneTree.
  • Events: trickle-down and bubble-up dispatch as Unity 6 does it (no at-target phase), callbacks with arguments, once and options, StopPropagation, events sent during dispatch queued; pointer, mouse, wheel, click, capture, change, geometry, attach/detach and focus events. Manipulators: PointerManipulator, MouseManipulator, activation filters, Clickable (capture, :active, repeat).
  • Controls: TextElement, Label, Button, Image (texture or sprite, scale modes, tint), Toggle (BaseField and value changes), Box, ScrollView (wheel scrolling, clipping; no scrollers drawn yet), TabView and Tab, TemplateContainer.
  • Panels: UIDocument (sorting order, nested documents) and PanelSettings (constant pixel size, constant physical size, scale with screen size; theme); the panel's root carries the theme. Layout is flexbox through taffy (MIT) in the native host (ui_layout), with Yoga's ways: min sizes auto are 0, percentage padding and margins resolve against the parent's border box, and rects round to the pixel grid. Drawing goes over the canvases (backgrounds, background images, borders, images, text in the style's font, size, color and alignment, with wrapping; overflow: hidden clips); the mouse gives pointer, mouse and wheel events, hover (:hover, enter/leave/over/out), focus and clicks.
  • Assets: .uxml, .uss and .tss import (Resources.Load and references by GUID), project:// URLs and relative paths; the built-in UIDocument and PanelSettings scripts. unity-theme://default is Tassix's own theme, with the sizes and colors Unity's runtime theme gives the controls.
  • Checked by ui_toolkit (6000.3): the tree, queries and UXML attributes, the cascade, event order, layout before and after changes (grow, wrap, reverse, percentages, absolute insets, min/max, display none, pixel rounding), the theme's styles for each control, and pointer capture from script-sent events. A sample builds a settings card from code (dotnet/samples/scenes/ui_toolkit.json).
  • Not yet: transitions, transforms (translate, rotate, scale), rounded corners and gradients in drawing, text editing (TextField), sliders and scrollers, keyboard and navigation events, world-space and render-texture panels, data binding.
  • Next: UI Toolkit stage 2: data binding (Unity.Properties' PropertyPath, DataBinding, ConverterGroup), ListView, DropdownField; then stage 3, Addressables, to run UnityChess.