refactor: UI Toolkit screen elements move into a shared module behind one entry point
Merged
HA
4d ago+546+546+012345678901234567890123456789-289-289-012345678901234567890123456789
Summary
- Moves the UI Toolkit screen-element code that screenshot annotations use into a shared module, so simulate-mouse-ui can find and press the same controls next. No behaviour change.
User Impact
- None.
screenshot --annotate-elementsreports the same UI Toolkit entries with the same coordinates.
Changes
- New assembly
UnityCLILoop.FirstPartyTools.Common.UIToolkit.Editor(Editor only, not auto-referenced, references Common.MouseUi).- Public entry point
UIToolkitScreenElements.CollectControls(probePointsForTopLeftBounds)and result typeUIToolkitScreenControl. Both work in top-left Game View pixels. - Internal parts: panel gathering and picking, element paths, the control walk, plus the classifier, panel kind, screen mapping and reachability probe moved with
git mv. Internals are visible to the test assemblies only.
- Public entry point
- Common.MouseUi exposes its internals to the new module, which uses
GameObjectPathUtility. - Screenshot keeps
UIToolkitElementCollector.Collect(elements, gameViewHeight)as an adapter. It supplies the uGUI probe points and converts the results back to bottom-left entries, using the same conversions in the same order as before. - Screenshot and the EditMode / PlayMode test assemblies reference the new module.
Verification
uloop compile: 0 errors. The one warning is an existing one in a test fixture.- EditMode, one class at a time:
UIToolkitElementClassifierTests13/13,UIToolkitPanelKindTests4/4,UIToolkitReachabilityProbeTests6/6,UIToolkitScreenMappingTests9/9,UIElementAnnotatorCollectTests11/11,OnionAssemblyDependencyTests83/83. - PlayMode
UIToolkitElementCollectorTests18/18. check-asmdef-policy: no violations.scripts/test-screenshot-uitoolkit-annotation.sh: PASS, with the coordinate checks against the elements-only capture (±1 px) passing.git statuswas unchanged after the run.