Version: 2020.3
이벤트 합성
Capture events

Event reference

UI Toolkit sends an event when a user interacts with elements from UI Toolkit and changes the state of those elements. For example, the following actions all have associated:

  • Resizing a window
  • Selecting a panel
  • Pressing a key on the keyboard

The event design is similar to the Event interface for HTML elements.

Event families

Event types fit into a hierarchy based on the EventBase class. Each event family implements an interface that defines the common characteristics for all events of the same family. For example, BlurEvent and FocusEvent use the FocusEventBase class.

Select any of the event types listed below for more information on the event, its parent class, and links to the API documentation.

Event reference table

The following table is a simple overview of each event type. For more information on an event, see the pages listed above.

Event type 설명 Trickles down Bubbles up Cancellable
Capture events
MouseCaptureEvent Sent when an element takes the mouse capture. 지원 지원
MouseCaptureOutEvent Sent when an element releases or otherwise loses the mouse capture. 지원 지원
PointerCaptureEvent Sent when an element captures a pointer. 지원 지원
PointerCaptureOutEvent Sent when an element releases a pointer. 지원 지원
Change events
ChangeEvent A generic event sent when the value of an element changes. 지원 지원
Command events
ValidateCommandEvent IMGUI sends this event while it determines whether the command will be handled by an element in the panel. 지원 지원 지원
ExecuteCommandEvent IMGUI sends this event when an element in the panel should execute a command. 지원 지원 지원
Drag events
DragExitedEvent Sent when the drag and drop process ends. 지원 지원
DragUpdatedEvent Sent when the dragged element moves over a drop target. 지원 지원 지원
DragPerformEvent Sent when the dragged element drops onto an acceptable target. 지원 지원 지원
DragEnterEvent The dragged element entered a new VisualElement. This event is sent when the drag operation begins. 지원
DragLeaveEvent The dragged element exited the current drop target. This event is sent when the drag operation ends. 지원
Focus events
FocusOutEvent Sent before an element loses focus. 지원 지원
FocusInEvent Sent before an element gains focus. 지원 지원
BlurEvent Sent after an element has lost focus. 지원
FocusEvent Sent after an element has gained focus. 지원
IMGUI events
IMGUIEvent Sent to encapsulate IMGUI-specific events. 지원 지원 지원
Input events
InputEvent Sent when data is input to a visual element, typically a control.
Keyboard events
KeyDownEvent Sent when the user presses a key on the keyboard. 지원 지원 지원
KeyUpEvent Sent when the user releases a key on the keyboard. 지원 지원 지원
Layout events
GeometryChangedEvent Event sent when either the position or the dimensions of an element changes.
Mouse events
MouseDownEvent Sent when the user presses a mouse button. 지원 지원 지원
MouseUpEvent Sent when the user releases a mouse button. 지원 지원 지원
MouseMoveEvent Sent when the user moves the mouse. 지원 지원 지원
WheelEvent Sent when the user activates the mouse wheel. 지원 지원 지원
MouseEnterWindowEvent Sent when the mouse enters a window. Yes
MouseLeaveWindowEvent Sent when the mouse leaves a window. Yes
MouseEnterEvent Sent when the mouse enters an element or one of its descendants. 지원 지원
MouseLeaveEvent Sent when the mouse leaves an element or one of its descendants. 지원 지원
MouseOverEvent Sent when the mouse enters an element. 지원 지원 지원
MouseOutEvent Sent when the mouse leaves an element. 지원 지원 지원
ContextClickEvent (obsolete) Sent when the user presses and releases the third mouse button. Exists for backwards compatibility with IMGUI. 지원 지원 지원
Pointer events
PointerDownEvent Sent when you press a pointer. 지원 지원 지원
PointerUpEvent Sent when you release a pointer. 지원 지원 지원
PointerMoveEvent Sent when the pointer changes state. 지원 지원 지원
PointerEnterEvent Sent when the pointer enters a visual element, or one of its descendants. 지원 지원
PointerLeaveEvent Sent when the pointer leaves a visual element and all of its descendants. 지원 지원
PointerOverEvent Sent when the pointer enters a visual element. 지원 지원 지원
PointerOutEvent Sent when the pointer leaves a visual element. 지원 지원 지원
PointerStationaryEvent Sent when a pointer type (like a stylus or finger) doesn’t change for a set amount of time determined by the operating system. 지원 지원 지원
PointerCancelEvent Sent when a pointer action is cancelled by the operating system. 지원 지원 지원
Panel events
AttachToPanelEvent Sent right after an element attaches to a panel.
DetachFromPanelEvent Sent just before an element detaches from a panel.
Tooltip events
TooltipEvent Tooltip is sent just before a tooltip is displayed. 지원 지원 지원

  • 2018–11–02 페이지 수정됨
이벤트 합성
Capture events
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961