Handles
- ArrowCap
- BeginGUI
- Button
- CircleCap
- ClearCamera
- color
- ConeCap
- CubeCap
- currentCamera
- CylinderCap
- Disc
- DotCap
- DrawAAPolyLine
- DrawBezier
- DrawCamera
- DrawCapFunction
- DrawLine
- DrawPolyLine
- DrawSolidArc
- DrawSolidDisc
- DrawSolidRectangleWithOutline
- DrawWireArc
- DrawWireDisc
- EndGUI
- FreeMoveHandle
- FreeRotateHandle
- Label
- lighting
- matrix
- PositionHandle
- RadiusHandle
- RectangleCap
- RotationHandle
- ScaleHandle
- ScaleSlider
- ScaleValueHandle
- SetCamera
- Slider2D
- Slider
- SnapValue
- SphereCap
Handles 控制柄
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.
注意:这是一个编辑器类,如果想使用它你需要把它放到工程目录下的Assets/Editor文件夹下。编辑器类在UnityEditor命名空间下。所以当使用C#脚本时,你需要在脚本前面加上 "using UnityEditor"引用。
Scene View style 3D GUI controls.
场景视图样式的3D GUI控制。
- Setting up 设置
- You must begin with a call to DrawCamera in order to set up the current camera. All 3d stuff done after DrawCamera uses the camera that was rendered.
- 你必须以DrawCamera调用开始以设置当前摄像机。DrawCamera使用相机之后所有3D东西完成被渲染。
- Drawing stuff 绘制东西
- You can draw 3D gizmo-like stuff. See Also: DrawCube, DrawLine. Set the color of them with Handles.color
- 可以绘制3D gizmo一样的东西。参见:DrawCube、DrawLine。用设置Handles.color它们的颜色。
- Traditional 2D GUI 传统的 2D GUI
- After having made a call to DrawCamera, you need to wrap traditional GUI calls in a Handles.BeginGUI / EndGUI pair.
- 已经制作了一个DrawCamera调用之后,必须包裹在传统GUI调用Handles.BeginGUI / EndGUI 对之中。
- Converting coordinate systems 转换坐标系统
- Use HandleUtility.GUIPointToWorldRay and HandleUtility.WorldToGUIPoint to convert coordinates between 2D GUI and 3D world coordinates.
- 使用HandleUtility.GUIPointToWorldRay 和 HandleUtility.WorldToGUIPoint 来转换2D GUI 和3D世界坐标之间的坐标。
Variables变量
-
The camera used for deciding where 3D handles end up
摄像机用于确定3D控制柄最后在哪里。
Class Variables类变量
-
Are handles lit? // 是否控制柄点亮?
-
Colors of the handles // 控制柄的颜色。
-
Matrix for all handle operations // 为所有控制柄操作的矩阵。
Class Functions类函数
-
Make a 3D Scene view position handle.
创建一个3D场景视图位置控制柄。 -
Make a Scene view rotation handle.
创建一个场景视图旋转控制柄。 -
Make a Scene view scale handle
创建一个场景视图缩放控制柄。 -
Make a Scene view radius handle
创建一个场景视图半径控制柄。 -
Make a 3D slider // 制作一个3D滑动柄。
-
Slide a handle in a 2D plane
在2D平面的滑动控制柄。 -
Make an unconstrained rotation handle.
创建不受约束的旋转控制柄。 -
Make an unconstrained movement handle.
制作一个不受约束的移动控制柄。 -
Make a directional scale slider
制作一个方向性缩放滑动柄。 -
Make a single-float draggable handle.
制作一个单一浮点数可拖动控制柄。 -
Make a 3D disc that can be dragged with the mouse
制作一个3D圆形,可以被鼠标拖动。 -
Make a 3D Button. // 制作一个3D按钮。
-
捕捉值
-
Draw a cube. Pass this into handle functions.
绘制一个立方体,传递到控制柄函数。 -
Draw a Sphere. Pass this into handle functions.
绘制一个球体,传递到控制柄函数。 -
Draw a Cone. Pass this into handle functions.
绘制一个圆锥体,传递到控制柄函数。 -
Draw a Cylinder. Pass this into handle functions.
绘制一个圆柱体,传递到控制柄函数。 -
Draw a camera-facing Rectangle. Pass this into handle functions.
绘制矩形,传递到控制柄函数。 -
Draw a camera-facing dot. Pass this into handle functions.
绘制点,传递到控制柄函数。 -
Draw a camera-facing Circle. Pass this into handle functions.
绘制圆形,传递到控制柄函数。 -
Draw an arrow like those used by the move tool.
绘制箭头,像那些用于移动工具。 -
Draw a line from p1 to p2.
从p1 到 p2绘制线。 -
Draw a line going through the list of all points.
通过所有点的列表绘制线。 -
Draw anti-aliased line specified with point array and width.
绘制指定的抗锯齿线带有点的数组和宽度。 -
Draw 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.
绘制带纹理的贝塞尔曲线通过开始和结束点带有给定切线。为了得到一个消除锯齿效果,使用是一个透明的白色像素和一个不透明的白色像素的1X2像素的纹理。贝塞尔曲线将使用这个纹理。 -
Draw the outline of a flat disc in 3D space.
在3D空间绘制一个圆的轮廓线。 -
Draw a circular arc in 3D space.
在3D空间绘制一个圆弧。 -
Draw a solid outlined rectangle in 3D space.
在3D空间绘制一个实心轮廓矩形。 -
Draw a solid flat disc in 3D space.
在3D空间绘制一个平面实心圆。 -
Draw a circular sector (pie piece) in 3D space.
在3D空间绘制一个圆扇形。 -
Make a text label positioned in 3D space.
在3D空间制作一个文本标签。 -
Clears the camera. // 清除相机。
-
Draws a camera inside a rectangle.
在矩形内绘制一个相机。 -
Set the current camera so all Handles and Gizmos are draw with its settings.
设置当前相机,因此所有控制柄和Gizmo被绘制,带有它的设置。 -
Begin a 2D GUI block inside the 3D handle GUI.
在3D 控制柄 GUI中,开始一个2D界面块。 -
End a 2D GUI block and get back to the 3D handle GUI.
结束2D界面块并返回到3D控制柄GUI。
Delegates委托
-
The function to use for drawing the handle e.g. Handles.RectangleCap.
该函数用于绘制控制柄。例如,Handles.RectangleCap。
最后修改:2011年7月9日 Saturday 13:25