The following table is a reference of all built-in controls available for UI Toolkit.
Control | 描述 | Bindable | Data Type | Namespace | Base Class |
---|---|---|---|---|---|
BoundsField |
A bounds value input field | 是 | UnityEngine.Bounds | UnityEditor.UIElements | BaseField<Bounds> |
BoundsIntField |
An integer bounds value input field | 是 | UnityEngine.BoundsInt | UnityEditor.UIElements | BaseField<BoundsInt> |
Box |
A simple outlined container element | 否 | UnityEngine.UIElements | VisualElement | |
Button |
A clickable text element that executes an action when pressed | 是 | string | UnityEngine.UIElements | TextElement |
ColorField |
A color value input field that allows color picking | 是 | UnityEngine.Color | UnityEditor.UIElements | BaseField<Color> |
CurveField |
A curve value input field that shows a preview of the curve | 是 | UnityEngine.AnimationCurve | UnityEditor.UIElements | BaseField<AnimationCurve> |
DoubleField |
A double value input field | 是 | double | UnityEditor.UIElements | TextValueField<double> |
EnumField |
An enum value input field that shows a dropdown | 是 | Enum | UnityEditor.UIElements | BaseField<Enum> |
EnumFlagsField |
An enum value input field with the Flag attribute | 是 | Enum | UnityEngine.UIElements | BaseMaskField<Enum> |
FloatField |
A float value input field | 是 | 浮点精度 | UnityEditor.UIElements | TextValueField<float> |
Foldout |
A container element that creates a collapsible section | 是 | bool | UnityEngine.UIElements | BindableElement |
GradientField |
A gradient value input field | 是 | UnityEngine.Gradient | UnityEditor.UIElements | BaseField<Gradient> |
Image |
A simple element that can represent an image or texture | 否 | UnityEngine.UIElements | VisualElement | |
IntegerField |
An integer value input field | 是 | int | UnityEditor.UIElements | TextValueField<int> |
Label |
A static text element | 是 | string | UnityEngine.UIElements | TextElement |
LayerField |
A popup selection field that allows selection of a layer | 是 | int | UnityEditor.UIElements | PopupField<int> |
LayerMaskField |
A popup selection field that allows selection of one or multiple layers | 是 | int | UnityEditor.UIElements | MaskField |
ListView |
A container element that can display items as a reorderable list | 是 | IList, UnityEngine.VisualElement | UnityEngine.UIElements | BindableElement |
LongField |
A long value input field | 是 | long | UnityEditor.UIElements | TextValueField<long> |
MaskField |
A popup selection field that allows selection of one or multiple items | 是 | int | UnityEditor.UIElements | BaseMaskField<int> |
MinMaxSlider |
A float-based slider input field that can represent a range | 是 | UnityEngine.Vector2 | UnityEngine.UIElements | BaseField<Vector2> |
ObjectField |
A UnityEngine.Object value input field | 是 | UnityEngine.Object | UnityEditor.UIElements | BaseField<Object> |
PopupField<T> |
A popup selection input field | 是 | typeof(T) | UnityEditor.UIElements | BasePopupField<T, T> |
PopupWindow |
A popup selection field that matches the EditorGUILayout.Popup IMGUI element | 是 | string | UnityEngine.UIElements | TextElement |
ProgressBar |
An element that shows a task progress | 是 | float, integer | UnityEditor.UIElements | BindableElement |
PropertyField |
A value input field based on the type of the bound serialized property | 是 | various | UnityEditor.UIElements | VisualElement |
RectField |
A rectangle/size value input field | 是 | UnityEngine.Rect | UnityEditor.UIElements | BaseCompositeField<Rect, FloatField, float> |
RectIntField |
An integer-based rectangle/size value input field | 是 | UnityEngine.RectInt | UnityEditor.UIElements | BaseCompositeField<RectInt, IntegerField, int> |
RepeatButton |
A clickable text element that executes an action repeatedly while it’s pressed | 是 | string | UnityEngine.UIElements | TextElement |
Scroller |
A horizontal or vertical scroll bar element | 否 | UnityEngine.UIElements | VisualElement | |
ScrollView |
A container element that displays its contents in a scrollable frame | 否 | UnityEngine.UIElements | VisualElement | |
Slider |
A float-based range bound slider input field | 是 | 浮点精度 | UnityEngine.UIElements | BaseSlider<float> |
SliderInt |
An integer-based range bound slider input field | 是 | int | UnityEngine.UIElements | BaseSlider<int> |
TagField |
A popup selection field that allows single selection of tag items | 是 | string | UnityEditor.UIElements | PopupField<string> |
TextElement |
A generic text element | 是 | string | UnityEngine.UIElements | BindableElement |
TextField |
A string value input field | 是 | string | UnityEngine.UIElements | TextInputBaseField<string> |
Toggle |
A clickable check box that can represent a binary state | 是 | bool | UnityEngine.UIElements | BaseField<bool> |
Toolbar |
A container element that can display tools in a tools window | 否 | UnityEditor.UIElements | VisualElement | |
TreeView |
A container element that can display items as a tree | 是 | UnityEngine.UIElements | VisualElement | |
Vector2Field |
A two-dimensional vector value input field | 是 | UnityEngine.Vector2 | UnityEditor.UIElements | BaseCompositeField<Vector2, FloatField, float> |
Vector2IntField |
A two-dimensional integer-based vector value input field | 是 | UnityEngine.Vector2Int | UnityEditor.UIElements | BaseCompositeField<Vector2Int, IntegerField, int> |
Vector3Field |
A three-dimensional vector value input field | 是 | UnityEngine.Vector3 | UnityEditor.UIElements | BaseCompositeField<Vector3, FloatField, float> |
Vector3IntField |
A three-dimensional integer-based vector value input field | 是 | UnityEngine.Vector3Int | UnityEditor.UIElements | BaseCompositeField<Vector3Int, IntegerField, int> |
Vector4Field |
A four-dimensional vector value input field | 是 | UnityEngine.Vector4 | UnityEditor.UIElements | BaseCompositeField<Vector4, FloatField, float> |