PrimitiveBoundsHandle

class in UnityEditor.IMGUI.Controls

切换到手册

描述

用于在 Scene View 中编辑包围体积的复合手柄基类。

This class allows you to display a shape with up to six control handles for simultaneously editing the size and center of a bounding volume. Dragging on any one control handle will expand the volume along the control handle's axis. All classes that inherit from this class also gain the following modifier keys while a control handle is being dragged:

Alt: Pin the center of the volume to its location at the time the control handle was clicked and grow the size in both directions along the control handle's axis of movement.
Shift: Uniformly scale the volume along all enabled axes in proportion to its size at the time the control handle was clicked.

The handle rendered by this class's DrawHandle method is affected by global state in the Handles class, such as Handles.matrix and Handles.color.

See Also: Editor.OnSceneGUI, Handles.SetCamera.

变量

axes指定哪些轴应显示控制手柄的标志。
center返回或指定手柄包围体积的中心。
handleColor返回或指定控制手柄的颜色。
midpointHandleDrawFunction显示控制手柄时使用的可选 CapFunction。如果未指定值,则默认为 Handles.DotHandleCap。
midpointHandleSizeFunctionAn optional SizeFunction to specify how large the control handles should be in the space of Handles.matrix. Defaults to a fixed screen-space size.
wireframeColor返回或指定线框形状的颜色。

构造函数

PrimitiveBoundsHandle创建 PrimitiveBoundsHandle 类的新实例。

公共函数

DrawHandle使用实例的当前配置在当前手柄摄像机中显示此实例的函数。
SetColor将 handleColor 和 wireframeColor 设置为相同的值。

受保护的函数

DrawWireframe绘制此实例的线框形状。子类必须实现此方法。
GetSize获取此实例包围体积的当前大小。
IsAxisEnabled获取指示是否为当前实例启用了指定轴的值。
OnHandleChanged在控制手柄被拖到场景中时使用的回调。
SetSize设置此实例包围体积的当前大小。
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961