Version: 2021.2
Testing UI
Testing inside the UI Builder

Debug styles

You might run into situations where you don’t know where a style is coming from. UI(User Interface) Allows a user to interact with your application. Unity currently supports three UI systems. More info
See in Glossary
Builder offers several tools to investigate styles.

To see where styles are coming from:

  1. Select the element in question.
  2. Go to the StyleSheet section of the InspectorA Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. More info
    See in Glossary
    .
  3. Expand the Matching Selectors foldout:

MatchingSelectorsFoldouts

Matching Selectors will display all USS Selectors acting on the current element, in the order in which they’re applied. Lower USS Selectors will always override the same style properties in higher USS Selectors. This list of USS Selectors will include both those coming from your own StyleSheets and those coming from the default Unity theme.

UI Toolkit debugger

If the Matching Selectors section doesn’t provide enough information, you can open the main UI Toolkit Debugger under Window > UI Toolkit > Debugger. Enable Preview mode in the UI Builder before using the UI Toolkit Debugger to Pick Element inside your Canvas.

Preview mode, found in the ViewportThe user’s visible area of an app on their screen.
See in Glossary
toolbarA row of buttons and basic controls at the top of the Unity Editor that allows you to interact with the Editor in various ways (e.g. scaling, translation). More info
See in Glossary
, removes the UI Builder picking overlays from the Canvas, leaving just your UI. UI Builder runs entirely on UI Toolkit, including the recreation of your in-progress UI, so the UI Toolkit Debugger works like in any other UI Toolkit window.

Testing UI
Testing inside the UI Builder
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961