Gizmos Manual     Reference     Scripting  
Scripting > Runtime Classes > Gizmos
Gizmos Class

Gizmos are used to give visual debugging or setup aids in the scene view.

All gizmo drawing has to be done in either OnDrawGizmos or OnDrawGizmosSelected functions of the script.

OnDrawGizmos is called every frame. All gizmos rendered within OnDrawGizmos are pickable.
OnDrawGizmosSelected is called only if the object the script is attached to is selected.

Class Variables
color

Sets the color for the gizmos that will be drawn next.

matrix

Set the gizmo matrix used to draw all gizmos.

Class Functions
DrawRay

Draws a ray starting at from to from + direction.

DrawLine

Draws a line starting at from towards to.

DrawWireSphere

Draws a wireframe sphere with center and radius.

DrawSphere

Draws a solid sphere with center and radius.

DrawWireCube

Draw a wireframe box with center and size.

DrawCube

Draw a solid box with center and size.

DrawIcon

Draw an icon at world position center.

DrawGUITexture

Draw a texture in screen coordinates. Useful for GUI backgrounds.