Version: 5.3 (switch to 5.4b)
IdiomaEnglish
  • C#
  • JS

Idioma de script

Selecciona tu lenguaje de programación favorito. Todos los fragmentos de código serán mostrados en este lenguaje.

Handles

class in UnityEditor

Sugiere un cambio

¡Éxito!

Gracias por ayudarnos a mejorar la calidad de la documentación de Unity. A pesar de que no podemos aceptar todas las sugerencias, leemos cada cambio propuesto por nuestros usuarios y actualizaremos los que sean aplicables.

Cerrar

No se puedo enviar

Por alguna razón su cambio sugerido no pudo ser enviado. Por favor <a>intente nuevamente</a> en unos minutos. Gracias por tomarse un tiempo para ayudarnos a mejorar la calidad de la documentación de Unity.

Cerrar

Cancelar

Cambiar al Manual

Descripción

Custom 3D GUI controls and drawing in the scene view.

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 / EndGUI pair within the //OnSceneGUI// function. You can use HandleUtility.GUIPointToWorldRay and HandleUtility.WorldToGUIPoint to convert coordinates between 2D GUI and 3D world coordinates.

Variables Estáticas

centerColorColor to use for handles that represent the center of something.
colorColors of the handles.
inverseMatrixThe inverse of the matrix for all handle operations.
lightingAre handles lit?
matrixMatrix for all handle operations.
secondaryColorSoft color to use for for general things.
selectedColorColor to use for the currently active handle.
xAxisColorColor to use for handles that manipulates the X coordinate of something.
yAxisColorColor to use for handles that manipulates the Y coordinate of something.
zAxisColorColor to use for handles that manipulates the Z coordinate of something.

Variables

currentCameraSetup viewport and stuff for a current camera.

Funciones Estáticas

ArrowCapDraw an arrow like those used by the move tool.
BeginGUIBegin a 2D GUI block inside the 3D handle GUI.
ButtonMake a 3D Button.
CircleCapDraw a camera-facing Circle. Pass this into handle functions.
ClearCameraClears the camera.
ConeCapDraw a Cone. Pass this into handle functions.
CubeCapDraw a cube. Pass this into handle functions.
CylinderCapDraw a Cylinder. Pass this into handle functions.
DiscMake a 3D disc that can be dragged with the mouse. Note: Use HandleUtility.GetHandleSize where you might want to have constant screen-sized handles.
DotCapDraw a camera-facing dot. Pass this into handle functions.
DrawAAConvexPolygonDraw anti-aliased convex polygon specified with point array.
DrawAAPolyLineDraw anti-aliased line specified with point array and width.
DrawBezierDraw textured bezier line through start and end points with the given tangents. To get an anti-aliased effect use a texture that is 1x2 pixels with one transparent white pixel and one opaque white pixel. The bezier curve will be swept using this texture.
DrawCameraDraws a camera inside a rectangle.
DrawDottedLineDraw a dotted line from p1 to p2.
DrawDottedLinesDraw a list of dotted line segments.
DrawLineDraw a line from p1 to p2.
DrawLinesDraw a list of line segments.
DrawPolyLineDraw a line going through the list of all points.
DrawSolidArcDraw a circular sector (pie piece) in 3D space.
DrawSolidDiscDraw a solid flat disc in 3D space.
DrawSolidRectangleWithOutlineDraw a solid outlined rectangle in 3D space.
DrawWireArcDraw a circular arc in 3D space.
DrawWireDiscDraw the outline of a flat disc in 3D space.
EndGUIEnd a 2D GUI block and get back to the 3D handle GUI.
FreeMoveHandleMake an unconstrained movement handle.
FreeRotateHandleMake an unconstrained rotation handle.
GetMainGameViewSizeGet the width and height of the main game view.
LabelMake a text label positioned in 3D space.
MakeBezierPointsRetuns an array of points to representing the bezier curve. See Handles.DrawBezier.
PositionHandleMake a 3D Scene view position handle.
RadiusHandleMake a Scene view radius handle.
RotationHandleMake a Scene view rotation handle.
ScaleHandleMake a Scene view scale handle.Note: Use HandleUtility.GetHandleSize where you might want to have constant screen-sized handles.
ScaleSliderMake a directional scale slider.Note: Use HandleUtility.GetHandleSize where you might want to have constant screen-sized handles.
ScaleValueHandleMake a single-float draggable handle.Note: Use HandleUtility.GetHandleSize where you might want to have constant screen-sized handles.
SelectionFrameDraw a camera facing selection frame.
SetCameraSet the current camera so all Handles and Gizmos are draw with its settings.
SliderMake a 3D slider.Note: Use HandleUtility.GetHandleSize where you might want to have constant screen-sized handles.
Slider2DSlide a handle in a 2D plane.
SnapValueRounds the value val to the closest multiple of snap (snap can only be positive).
SphereCapDraw a Sphere. Pass this into handle functions.

Delegados

DrawCapFunctionThe function to use for drawing the handle e.g. Handles.RectangleCap.