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.DrawLine 绘制线
static function DrawLine (p1 : Vector3, p2 : Vector3) : void
Description描述
Draw a line from p1 to p2.
从p1 到 p2绘制线。
Draw Line 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 object to 0,0,0.
//绘制线用来连接带有脚本的物体
//如果目标物体没有任何物体被附加,然它绘制一条线从物体到0,0,0
@CustomEditor (ConnectedObjects)
class ConnectLineHandle extends Editor {
function OnSceneGUI () {
for(var i = 0; i < target.objs.Length; i++)
if(target.objs[i])
Handles.DrawLine(target.transform.position,
target.objs[i].transform.position);
else
Handles.DrawLine(target.transform.position, Vector3.zero);
}
}
And the script attached to this Handle:
该脚本附加到这个控制柄物体:
//ConnectedObjects.js
var objs : GameObject[] = null;
最后修改:2011年7月8日 Friday 18:05