Version: 2020.3
控件
绑定

Controls reference

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>
控件
绑定