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.
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世界坐标之间的坐标。


Class Variables类变量

Class Functions类函数


Page last updated: 2011-7-9