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

Scope

class in UnityEditor.Experimental.UIElements.GraphView

/

Inherits from:Experimental.UIElements.GraphView.GraphElement

Switch to Manual

Description

This class allows for nodes to be grouped into a common area, or Scope. This class includes methods that automatically resize and position the Scope to encompass the group of nodes.

Variables

autoUpdateGeometryEnables or disables the automatic resizing and positioning of the Scope.
containedElementsThe list of GraphElements contained by the Scope.
containedElementsRectThe rect containing the GraphElements encompassed by the Scope. The rect is expressed in local coordinates.
headerContainerReturns the header container for the Scope. Use this header container to customizer the header of the Scope.

Constructors

ScopeScope constructor.

Public Functions

AcceptsElementWhether the GraphElement can be added to this scope.
AddElementAdds a GraphElement to the Scope.
AddElementsAdds GraphElements to the Scope.
ContainsElementDetermines if the Scope contains the specified GraphElement.
GetPositionReturns the geometry of the Scope.
HitTestDetermines whether the specified point is within the selectable area of the Scope.
OverlapsDetermines whether the specified rect overlaps the Scope.
RemoveElementRemoves an element from the Scope.
RemoveElementsRemoves elements from the Scope.
RemoveElementsWithoutNotificationRemoves elements from the Scope but do not send a notification.
SetPositionSets the geometry of the Scope.
UpdateGeometryFromContentUpdates the size and position of the Scope based on its contents.

Protected Functions

OnElementsAddedCalled when GraphElements are added to the Scope.
OnElementsRemovedCalled when GraphElements are removed from the Scope.
ScheduleUpdateGeometryFromContentSchedules the update of the size and position of the Scope based on its contents.
SetScopePositionOnlyChange the position of the scope but does not move its elements.

Inherited members

Static Variables

defaultFocusIndexThe default focus index for newly created elements.

Variables

canGrabFocus如果元素可以获得焦点,则返回 true。
focusController返回此元素的焦点控制器。
focusIndex用于对焦点环中可获得焦点的元素排序的整数。负值表示元素不能获得焦点。
capabilitiesThe GraphElement's capabilities.
elementTypeColorThe color used for the MiniMap view.
layerThe GraphElement's layer in the graph.
selectedTrue if the GraphElement is currently selected.
titleThe GraphElement's title.
childCount 此对象的 contentContainer 中的子元素数
clippingOptions是否应将此元素裁剪为绘制到其边界。
contentContainer 子元素通常添加到此元素中
dataWatch对此元素 DataWatch 接口的访问。
enabledInHierarchy如果 VisualElement 是在它自己的层级视图中启用,则返回 true。
enabledSelf如果 VisualElement 是本地启用,则返回 true。
persistenceKey用于查看数据持久性(即树展开状态、滚动位置、缩放级别)。
schedule检索此 VisualElement 的 IVisualElementScheduler
shadow 访问此元素物理层级视图
style引用此元素的样式对象。
this[int] 访问此元素物理层级视图
tooltipText to display inside an information box after the user hovers the element for a small amount of time.
userData此属性可用于将特定于应用程序的用户数据与此 VisualElement 关联。

Public Functions

HandleEvent处理事件,通常是通过执行与事件关联的回调处理事件。
HasBubbleUpHandlersReturn true if event handlers for the event propagation BubbleUp phase have been attached on this object.
HasTrickleDownHandlersReturns true if event handlers, for the event propagation TrickleDown phase, are attached to this object.
RegisterCallbackAdds an event handler to the instance. If the event handler has already been registered for the same phase (either TrickleDown or BubbleUp) then this method has no effect.
SendEventSends an event to the event handler.
UnregisterCallback从此实例删除回调。
Blur通知元素释放焦点。
Focus尝试让此元素获得焦点。
GetGlobalCenterGet the GraphElement's center point.
IsAscendableChecks if the GraphElement is automatically brought to front when selected.
IsDroppableThe GraphElement is drag&droppable.
IsMovableThe GraphElement is movable.
IsResizableThe GraphElement is resizable.
IsSelectableThe GraphElement is selectable.
IsSelectedThe GraphElement is currently selected in specific container.
OnSelectedCalled when the GraphElement is selected.
OnUnselectedCalled when the GraphElement is unselected.
ResetLayerReset the GraphElement to its original layer.
SelectSelect the GraphElement.
UnselectDeselect the GraphElement.
Add向此元素的 contentContainer 添加一个元素
AddStyleSheetPath将此样式表文件添加到此元素的应用样式列表中
BringToFront将此元素放到其父子列表的末尾。此元素将显示在所有重叠的同级元素前方。
Children从元素的 contentContainer 返回元素
Clear从此元素的 contentContainer 中删除所有子元素
Contains如果元素是此 VisualElement 的直接子级,则返回 true
ElementAt检索相应位置的子元素
EnableInClassListEnables or disables the class with the given name.
FindAncestorUserData向上搜索此 VisualElement 的层级视图并检索存储的 userData(如果找到)。
FindCommonAncestor查找 VisualTree 层级视图中两个 VisualElement 之间的最低共同上级
GetEnumerator允许循环访问此元素的子级
GetFirstAncestorOfType从此元素的父级开始向上访问层级视图,返回第一个此类型的 VisualElement
GetFirstOfType从此元素开始向上访问层级视图,返回第一个此类型的 VisualElement
GetFullHierarchicalPersistenceKey将此 VisualElement 与其父级的 VisualElement.persistenceKey 进行组合,从而创建更具唯一性的键以供 VisualElement.GetOrCreatePersistentData 使用。
GetOrCreatePersistentData引用现有的持久化对象和键,返回以保持的状态填充的对象或原样返回对象。
HasStyleSheetPath检查此样式表文件是否位于此元素的应用样式列表中
IndexOfRetrieves the child index of the specified VisualElement.
Insert向此元素的 contentContainer 插入一个元素
MarkDirtyRepaintTriggers a repaint of the VisualElement on the next frame.
OnPersistentDataReady当持久数据可访问和/或当数据或持久键发生更改时调用(VisualElement 有正确的父子关系)。
OverwriteFromPersistedData从持久性数据存储覆盖对象。
PlaceBehind将此元素放在其父子列表中同级元素之前紧邻的位置。如果此元素和同级元素位置重叠,此元素将显示在其同级元素之后。
PlaceInFront将此元素放在其父子列表中同级元素之后紧邻的位置。如果此元素和同级元素位置重叠,此元素将显示在其同级元素之前。
Remove从层级视图中删除此子级
RemoveAt从此元素的 contentContainer 中删除位于此位置的子元素
RemoveFromHierarchy将此元素从其父层级视图中删除
RemoveStyleSheetPath从此元素的应用样式列表中删除此样式表文件
SavePersistentData将持久性数据写入文件。
SendEventSends an event to the event handler.
SendToBack将此元素发送到其父子列表的开始处。此元素将显示在所有重叠的同级元素之后。
SetEnabledChanges whether the current VisualElement is enabled or not. When disabled, a VisualElement does not receive most events.
Sort重新排序来自此 VisualElement contentContainer 的子元素。
ToggleInClassListToggles between adding and removing the given class name from the class list.

Protected Functions

OnStyleResolved当对象样式发生更改时回调。