Handles Manual     Reference     Scripting  
Scripting > Editor Classes > Handles
Handles Class

Various drawing stuff.

Note: This is an editor class. To use it you have to place your script in Assets/Editor inside your project folder. Editor classes are in the UnityEditor namespace so for C# scripts you need to add "using UnityEditor;" at the beginning of the script.

Variables
currentCamera

The camera used for deciding where 3D handles end up

Class Variables
lighting

Are handles lit?

color

Colors of the handles

matrix

Matrix for all handle operations

Class Functions
PositionHandle

Make a 3D Scene view position handle.

RotationHandle

Make a Scene view rotation handle.

ScaleHandle

Make a Scene view scale handle

Slider

Make a 3D slider

FreeRotateHandle

Make an unconstrained rotation handle.

FreeMoveHandle

Make an unconstrained movement handle.

ScaleSlider

Make a directional scale slider

ScaleValueHandle

Make a single-float draggable handle.

Disc

Make a 3D disc that can be dragged with the mouse

Button

Make a 3D Button.

CubeCap

Draw a cube. Pass this into handle functions

SphereCap

Draw a Sphere. Pass this into handle functions.

ConeCap

Draw a Cone. Pass this into handle functions.

CylinderCap

Draw a Cylinder. Pass this into handle functions.

RectangleCap

Draw a camera-facing Rectangle. Pass this into handle functions.

DotCap

Draw a camera-facing dot. Pass this into handle functions.

ArrowCap

Draw an arrow like those used by the move tool.

DrawCylinder

OBSOLETE warning DrawCylinder has been renamed to CylinderCap.

DrawCube

OBSOLETE warning DrawCube has been renamed to CubeCap.

DrawSphere

OBSOLETE warning DrawSphere has been renamed to SphereCap.

DrawCone

OBSOLETE warning DrawCone has been renamed to ConeCap.

DrawRectangle

OBSOLETE warning DrawRectangle has been renamed to RectangleCap.

DrawArrow

OBSOLETE warning DrawArrow has been renamed to ArrowCap.

DrawLine

Draw a line from p1 to p2.

DrawPolyLine

Draw a line going through the list of all points.

DrawAAPolyLine

Draw anti-aliased line specified with point array.

DrawWireDisc

Draw the outline of a flat disc in 3D space.

DrawWireArc

Draw a circular arc in 3D space.

DrawSolidDisc

Draw a solid flat disc in 3D space.

DrawSolidArc

Draw a circular sector (pie piece) in 3D space.

Label

Make a text label positioned in 3D space.

ClearCamera

Clears the camera.

DrawCamera

Draws a camera inside a rectangle.

SetCamera

Set the current camera so all Handles and Gizmos are draw with its settings.

BeginGUI

Begin a 2D GUI block inside the 3D handle GUI.

EndGUI

End a 2D GUI block and get back to the 3D handle GUI.

Delegates
DrawCapFunction

The function to use for drawing the handle e.g. Handles.DrawRectangle.