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.DrawAAPolyLine 绘制AA多段线
static function DrawAAPolyLine (params points : Vector3[]) : void
static function DrawAAPolyLine (width : float, params points : Vector3[]) : void
static function DrawAAPolyLine (lineTex : Texture2D, params points : Vector3[]) : void
static function DrawAAPolyLine (lineTex : Texture2D, width : float, params points : Vector3[]) : void
Parameters参数
-
lineTexThe AA texture used for rendering. To get an anti-aliased effect use a texture that is 1x2 pixels with one transparent white pixel and one opaque white pixel.
AA纹理用于渲染。为了得到一个消除锯齿的效果,使用是一个透明的白色像素和一个不透明的白色像素的1X2像素的纹理。 -
widthThe width of the line. Note: Use HandleUtility.GetHandleSize where you might want to have constant screen-sized handles.
线的宽度。注意:使用HandleUtility.GetHandleSize你可能希望有恒定屏幕大小的控制柄。 -
pointsList of points to build the line from.
用来构建线点的列表
Description描述
Draw anti-aliased line specified with point array and width.
绘制指定的抗锯齿线带有点的数组和宽度。
Note: Use HandleUtility.GetHandleSize where you might want to have constant screen-sized handles.
注意:使用HandleUtility.GetHandleSize你可能希望有恒定屏幕大小的控制柄。
PolyLine that connects all the objects in the Scene View.
在场景视图多段线连接所有物体。
// Draw lines to the connected game objects that a script has.
// if the target object doesnt have any game objects attached
// then it draws a line from the Last checked object to 0,0,0
//绘制线用来连接带有脚本的物体
//如果目标物体没有任何物体被附加,然它绘制一条线从物体到0,0,0
@CustomEditor (ConnectedPolyLine)
class ConnectedPolyLineHandle extends Editor {
var positions : Vector3[];
function OnSceneGUI () {
if(target.polyLineObjs.Length > 0)
positions = new Vector3[target.polyLinesObjs.Length];
for(var i = 0; i < target.polyLineObjs.Length; i++)
if(target.polyLineObjs[i])
positions[i] = target.polyLineObjs[i].transform.position;
else
positions[i] = Vector3.zero;
Handles.DrawPolyLine(positions);
}
}
And the script attached to this Handle:
该脚本附加到这个控制柄物体:
//ConnectedPolyLine.js
var polyLineObjs : GameObject[];
最后修改:2011年7月8日 Friday 20:08