Version: 2019.1

Handles

class in UnityEditor

マニュアルに切り替える

説明

シーンビューで 3D GUI の制御と描画のカスタマイズを行うクラス

Handles are the 3D controls that Unity uses to manipulate items in the Scene view. There are a number of built-in Handle GUIs, such as the familiar tools to position, scale and rotate an object via the Transform component. However, it is also possible to define your own Handle GUIs to use with custom component editors. Such GUIs can be a very useful way to edit procedurally-generated Scene content, "invisible" items and groups of related objects, such as waypoints and location markers.

You can also supplement the 3D Handle GUI in the Scene with 2D buttons and other controls overlaid on the Scene view. This is done by enclosing standard Unity GUI calls in a Handles.BeginGUI and Handles.EndGUI pair within the Editor.OnSceneGUI function. You can use HandleUtility.GUIPointToWorldRay and HandleUtility.WorldToGUIPoint to convert coordinates between 2D GUI and 3D world coordinates.

Static 変数

centerColor中心を示すハンドルに使用する色
colorColors of the handles.
inverseMatrixすべてのハンドル操作の逆行列
lightingハンドルが点灯しているかどうか
matrixすべてのハンドル操作の行列
preselectionColorColor to use to highlight an unselected handle currently under the mouse pointer.
secondaryColorSoft color to use for for general things.
selectedColor現在アクティブなハンドルに使用する色
xAxisColorColor to use for handles that manipulates the X coordinate of something.
yAxisColorY 座標を操作するハンドルに使用する色
zAxisColorZ 座標を操作するハンドルに使用する色
zTestzTest of the handles.

変数

currentCameraビューポートや各種設定をするためにアクセスする現在使用しているカメラ

Static 関数

ArrowHandleCapMove ツールで使用されるような Arrow を描画します。
BeginGUI3D ハンドル GUI 内で 2D GUI の描画を開始します。
ButtonMake a 3D Button.
CircleHandleCapサークルハンドルを描き、これをハンドル関数に渡します。
ClearCameraカメラをクリアします。
ConeHandleCapコーン(円錐) ハンドルを描き、これをハンドル関数に渡します。
CubeHandleCapキューブハンドルを描き、これをハンドル関数に渡します。
CylinderHandleCapシリンダー ハンドルを描き、これをハンドル関数に渡します。
Discマウスでドラッグして 3D ディスクを作ります。
DotHandleCapドットハンドルを描き、これをハンドル関数に渡します。
DrawAAConvexPolygonポイント配列で指定されたアンチエイリアス Convex ポリゴンを描画します。
DrawAAPolyLine位置の配列と幅で指定したアンチエイリアスのかかった線を描きます。
DrawBezier指定した接線と始点と終点を通るテクスチャベジェ曲線を描画します。
DrawCamera矩形内部にカメラを描画します。
DrawDottedLine p1 から p2 に点線を描画します。
DrawDottedLines含まれる線分を点線で描画します。
DrawGizmosDraw a subset of Gizmos (before or after postprocessing) for the given camera.
DrawLine p1 から p2 にラインを描画します。
DrawLines含まれる線分を描画します。
DrawPolyLineDraw a line going through the list of points.
DrawSelectionFrameカメラに面しているセレクションフレームを描画します。
DrawSolidArc3D 空間に扇形を描画します。
DrawSolidDisc中の空間まで色のついた、フラットな円を 3D 空間に描画します。
DrawSolidRectangleWithOutline3D 空間に太い実線の矩形を描画します。
DrawWireArc3D 空間に円弧を描画します。
DrawWireCube center と size からキューブを描画します
DrawWireDisc3D 空間でフラットな円盤のアウトラインを描画します。
EndGUI現在のハンドルカメラ上で 2D GUI のブロックを終了し、3D ハンドル GUI に戻ります。
FreeMoveHandle制約のない移動ハンドルを作成します。
FreeRotateHandle制約のない回転ハンドルを作成します。
GetMainGameViewSizeGet the width and height of the main game view.
Label3D 空間に配置されるテキスト ラベルを作成します。
MakeBezierPointsRetuns an array of points to representing the bezier curve.
PositionHandleMake a position handle.
RadiusHandleシーンビューに Radius ハンドルを作成します。
RectangleHandleCap矩形ハンドルを描き、これをハンドル関数に渡します。
RotationHandleシーンビューの Rotation ハンドルを作ります。
ScaleHandleシーンビューの Scale ハンドルを作成します。
ScaleSliderディレクショナルスケールスライダーを作成します。
ScaleValueHandleMake a 3D handle that scales a single float.
SetCameraすべての Handle と Gizmo がその設定で描画されるように現在のカメラを設定してください。
SliderMake a 3D slider that moves along one axis.
Slider2DMake a 3D slider that moves along a plane defined by two axes.
SnapValue val 値を snap の最も近い倍数に四捨五入します (snap の値は正数のみ可)。
SphereHandleCapスフィア(球体) ハンドルを描き、これをハンドル関数に渡します。

デリゲート

CapFunction例えば、ハンドルを描画するために使用する関数 Handles.RectangleCap
SizeFunctionA delegate type for getting a handle's size based on its current position.