Experimental: this API is experimental and might be changed or removed in the future.

Dragger

class in UnityEditor.Experimental.UIElements.GraphView

/

Inherits from:Experimental.UIElements.Manipulator

Switch to Manual

Description

用于使用鼠标拖动元素的基本操控器。

Variables

clampToParentEdges如果为 true,它将不允许拖动的元素退出父元素的边缘。
panSpeed当元素被拖动到图的边缘附近时,会发生平移。这可以控制平移速度。

Constructors

DraggerDragger 构造函数。

Protected Functions

CalculatePosition计算拖动的元素的新位置。
OnMouseDown在发生鼠标按下事件时调用。
OnMouseMove发生鼠标移动事件时调用。
OnMouseUp发生鼠标松开事件时调用。
RegisterCallbacksOnTarget调用以在目标元素上注册单击事件回调。
UnregisterCallbacksFromTarget调用以从目标元素取消注册单击事件回调。

Inherited members

Variables

targetThe element that handles the interaction.