UnityEngine.UIElementsModule

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

The UIElements module implements the UIElements retained mode UI framework.

Classes

AttachToPanelEventEvent sent after an element is added to an element that is a descendent of a panel.
BaseField<T0>Abstract base class for controls.
BaseFieldTraits<T0,T1>Traits for the BaseField.
BaseSlider<T0>This is a base class for the Slider fields.
BindableElementElement that can be bound to a property.
BlurEventEvent sent immediately after an element has lost focus. This event trickles down, it does not bubble up, and it cannot be cancelled.
BoxStyled visual element to match the IMGUI Box Style.
ButtonA clickable button.
CallbackEventHandlerInterface for classes capable of having callbacks to handle events.
ChangeEvent<T0>Sends an event when a value in a field changes.
ClickableManipulator that tracks Mouse events on an element and callbacks when the elements is clicked.
CommandEventBase<T0>Base class for command events.
ContextClickEventThe event sent when clicking the right mouse button.
ContextualMenuManagerUse this class to display a contextual menu.
ContextualMenuManipulatorManipulator that displays a contextual menu when the user clicks the right mouse button or presses the menu key on the keyboard.
ContextualMenuPopulateEventThe event sent when a contextual menu requires menu items.
CustomStyleResolvedEventEvent sent after the custom style properties of a VisualElement have been resolved.
DetachFromPanelEventEvent sent just before an element is detach from its parent, if the parent is the descendant of a panel.
DragAndDropEventBase<T0>Base class for drag and drop events.
DragEnterEventUse the DragEnterEvent class to manage events that occur when dragging enters an element or one of its descendants. The DragEnterEvent is cancellable, it does not trickle down, and it does not bubble up.
DragExitedEventThe event sent to a dragged element when the drag and drop process ends.
DragLeaveEventUse the DragLeaveEvent class to manage events sent when dragging leaves an element or one of its descendants. The DragLeaveEvent is cancellable, it does not trickle down, and it does not bubble up.
DragPerformEventThe event sent to an element when another element is dragged and dropped on the element.
DragUpdatedEventThe event sent when the element being dragged enters a possible drop target.
DropdownMenuA drop-down menu.
DropdownMenuActionA menu action item.
DropdownMenuEventInfoThis class provides information about the event that triggered displaying the drop-down menu.
DropdownMenuItemAn item in a drop-down menu.
DropdownMenuSeparatorA separator menu item.
EventBaseThe base class for all UIElements events.
EventBase<T0>Generic base class for events, implementing event pooling and automatic registration to the event type system.
EventDispatcherDispatches events to a IPanel.
ExecuteCommandEventThe event sent when an element should execute a command.
FocusableBase class for objects that can get the focus.
FocusChangeDirectionBase class for defining in which direction the focus moves in a focus ring.
FocusControllerClass in charge of managing the focus inside a Panel.
FocusEventEvent sent immediately after an element has gained focus. This event trickles down, it does not bubble up, and it cannot be cancelled.
FocusEventBase<T0>Base class for focus related events.
FocusInEventEvent sent immediately before an element gains focus. This event trickles down and bubbles up. This event cannot be cancelled.
FocusOutEventEvent sent immediately before an element loses focus. This event trickles down and bubbles up. This event cannot be cancelled.
FoldoutCollapsable section of UI.
GeometryChangedEventEvent sent after layout calculations, when the position or the dimension of an element changes. This event cannot be cancelled, it does not trickle down, and it does not bubble up.
IBindingExtensionsExtensions methods to provide additional IBindable functionality.
ImageA VisualElement representing a source texture.
IMGUIContainerElement that draws IMGUI content.
IMGUIEventClass used to send a IMGUI event that has no equivalent UIElements event.
ImmediateModeElementVisualElement that can implement custom immediate mode rendering.
INotifyValueChangedExtensionsINotifyValueChangedExtensions is a set of extension methods useful for objects implementing INotifyValueChanged.
InputEventSends an event when text from a TextField changes.
KeyboardEventBase<T0>Base class for keyboard events.
KeyDownEventEvent sent when a key is pressed on the keyboard. This event trickles down and bubbles up. This event is cancellable.
KeyUpEventEvent sent when a key is released on the keyboard. This event trickles down and bubbles up. This event is cancellable.
LabelProvides an Element displaying text.
ListViewA vertically scrollable area that only creates visual elements for visible items while allowing the binding of many more items. As the user scrolls, visual elements are recycled and re-bound to new data items.
ManipulatorBase class for all Manipulator implementations.
MinMaxSliderA min/max slider containing a representation of a range.
MouseCaptureControllerClass that manages capturing mouse events.
MouseCaptureEventEvent sent after a handler starts capturing the mouse.
MouseCaptureEventBase<T0>Event sent when the handler capturing the mouse changes.
MouseCaptureOutEventEvent sent before a handler stops capturing the mouse.
MouseDownEventMouse down event.
MouseEnterEventEvent sent when the mouse pointer enters an element or one of its descendent elements. The event is cancellable, it does not trickle down, and it does not bubble up.
MouseEnterWindowEventEvent sent when the mouse pointer enters a window. The event is cancellable, it does not trickle down, and it does not bubble up.
MouseEventBase<T0>The base class for mouse events.
MouseLeaveEventEvent sent when the mouse pointer exits an element and all its descendent elements. The event is cancellable, it does not trickle down, and it does not bubble up.
MouseLeaveWindowEventEvent sent when the mouse pointer exits a window. The event is cancellable, it does not trickle down, and it does not bubble up.
MouseManipulatorMouseManipulators have a list of activation filters.
MouseMoveEventMouse move event.
MouseOutEventEvent sent when the mouse pointer exits an element. The event trickles down, it bubbles up, and it is cancellable.
MouseOverEventEvent sent when the mouse pointer enters an element. The event trickles down, it bubbles up, and it is cancellable.
MouseUpEventMouse up event.
PanelChangedEventBase<T0>Abstract base class for events notifying of a panel change.
PopupWindowStyled visual element that matches the EditorGUILayout.Popup IMGUI element.
RepeatButtonA button that executes an action repeatedly while it is pressed.
ScrollerA vertical or horizontal scrollbar.
ScrollViewDisplays its contents inside a scrollable frame.
SliderA slider containing floating point values.
SliderIntA slider containing Integer discrete values.
TemplateContainerTemplate Container.
TextElementAbstract base class for VisualElement containing text.
TextFieldA textfield is a rectangular area where the user can edit a string.
TextInputBaseField<T0>Abstract base class used for all text-based fields.
ToggleThis is the Toggle field.
TooltipEventEvent sent to find the first element that displays a tooltip.
TypedUxmlAttributeDescription<T0>Base class for all the uxml specific attributes.
UQueryUQuery is a set of extension methods allowing you to select individual or collection of visualElements inside a complex hierarchy.
UQueryExtensionsUQuery is a set of extension methods allowing you to select individual or collection of visualElements inside a complex hierarchy.
UxmlAttributeDescriptionBase class for describing an XML attribute.
UxmlBoolAttributeDescriptionDescribes a XML bool attribute.
UxmlChildElementDescriptionDescribe an allowed child element for an element.
UxmlColorAttributeDescriptionDescribes a XML attribute representing a Color as a string.
UxmlDoubleAttributeDescriptionDescribes a XML double attribute.
UxmlEnumAttributeDescription<T0>Describes a XML attribute representing an enum as a string.
UxmlEnumerationRestricts the value of an attribute to be taken from a list of values.
UxmlFactory<T0,T1>Generic base class for UXML factories, which instantiate a VisualElement using the data read from a UXML file.
UxmlFactory<T0>UxmlFactory specialization for classes that derive from VisualElement and that shares its traits, VisualElementTraits.
UxmlFloatAttributeDescriptionDescribes a XML float attribute.
UxmlIntAttributeDescriptionDescribes a XML int attribute.
UxmlLongAttributeDescriptionDescribes a XML long attribute.
UxmlRootElementFactoryFactory for the root UXML element.
UxmlRootElementTraits UxmlTraits for the UXML root element.
UxmlStringAttributeDescriptionDescribes a XML string attribute.
UxmlTraitsDescribes a VisualElement derived class for the parsing of UXML files and the generation of UXML schema definition.
UxmlTypeRestrictionBase class to restricts the value of an attribute.
UxmlValueBoundsRestricts the value of an attribute to be within the specified bounds.
UxmlValueMatchesRestricts the value of an attribute to match a regular expression.
ValidateCommandEventThe event sent to probe which elements accepts a command.
VisualElementBase class for objects that are part of the UIElements visual tree.
VisualElementExtensionsVisualElementExtensions is a set of extension methods useful for VisualElement.
VisualElementFocusChangeDirectionDefine focus change directions for the VisualElementFocusRing.
VisualElementFocusRingImplementation of a linear focus ring. Elements are sorted according to their focusIndex.
VisualTreeAssetInstances of this class hold a tree of `VisualElementAsset`s. It is created from an UXML file, and each `VisualElementAsset` represents a UXML node inside this file. A `VisualTreeAsset` can be Cloned to yield a tree of `VisualElement`s.
WheelEventMouse wheel event.

Structs

BackgroundDescribes a VisualElement background.
CreationContextThis class is used during UXML template instantiation.
CursorScript interface for VisualElement cursor style property IStyle.cursor.
CustomStyleProperty<T0>Define a custom style property for an element to be retrieved with CustomStyleResolvedEvent.
EventDispatcherGateGates control when the dispatcher processes events.
LengthReprensents a distance value.
ManipulatorActivationFilterUsed by manipulators to match events against their requirements.
StyleBackgroundStyle value that can be either a Background or a StyleKeyword.
StyleColorStyle value that can be either a Color or a StyleKeyword.
StyleCursorStyle value that can be either a Cursor or a StyleKeyword.
StyleEnum<T0>Style value that can be either an enum or a StyleKeyword.
StyleFloatStyle value that can be either a float or a StyleKeyword.
StyleFontStyle value that can be either a Font or a StyleKeyword.
StyleIntStyle value that can be either an integer or a StyleKeyword.
StyleLengthStyle value that can be either a Length or a StyleKeyword.
TimerStateContains timing information of scheduler events.
UQueryBuilder<T0>Utility Object that contructs a set of selection rules to be ran on a root visual element.
UQueryState<T0>Query object containing all the selection rules. Can be saved and rerun later without re-allocating memory.
VisualElementStyleSheetSetThis structure manipulates the set of StyleSheet objects attached to the owner VisualElement.

Enumerations

AlignDefines the alignement behavior along an axis.
ContextTypeDescribes in which context a VisualElement hierarchy is being ran.
DisplayStyleDefines how an element is displayed in the layout.
FlexDirectionDefines the main-axis of the flex layout.
JustifyDefines the alignment along the main axis, how is extra space distributed.
LengthUnitDescribes how to interpret a Length value.
MouseButtonDescribes a MouseButton.
OverflowDefines what should happend if content overflows an element bounds.
PickingModeDescribes the picking behavior.
PositionDefaines how the position values are interpreted by the layout engine.
PropagationPhaseThe propagation phases of an event.
ScrollViewModeMode configuring the ScrollView for the intended usage.
SelectionTypeControls how many items can be selected at once.
SliderDirectionThis is the direction of the Slider and SliderInt.
StyleKeywordKeyword that can be used on any style value types.
TrickleDownUse this enum to specify during which phases the event handler is executed.
VisibilitySpecifies whether or not an element is visible.
WhiteSpaceWord wrapping over multiple lines if not enough space is available to draw the text of an element.
WrapBy default, items will all try to fit onto one line. You can change that and allow the items to wrap as needed with this property.
对文档有任何疑问,请移步至开发者社区提问,我们将尽快为您解答