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一样的东西。参见:DrawCubeDrawLine。用设置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.GUIPointToWorldRayHandleUtility.WorldToGUIPoint 来转换2D GUI 和3D世界坐标之间的坐标。

Variables变量

Class Variables类变量

Class Functions类函数

Delegates委托

Page last updated: 2011-7-9