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.DrawSolidRectangleWithOutline 绘制实心轮廓矩形
static function DrawSolidRectangleWithOutline (verts : Vector3[], faceColor : Color, outlineColor : Color) : void
Parameters参数
- vertsthe 4 vertices of the rectangle in world coordinates
在世界坐标矩形的4个顶点
Description描述
Draw a solid outlined rectangle in 3D space.
在3D空间绘制一个实心轮廓矩形。
Solid rectangle with a black outline in the Scene View.
在场景视图的实心矩形并带有黑色轮廓
// Create a semi transparent rectangle that lets you modify
// the "range" var that resides in "SolidRectangleExample.js"
//创建一个半透明的矩形,可以在SolidRectangleExample.js中修改range变量
@CustomEditor (SolidRectangleExample)
class DrawSolidRectangle extends Editor {
function OnSceneGUI () {
var pos : Vector3 = target.transform.position;
var verts : Vector3[] = [Vector3(pos.x - target.range,pos.y,pos.z-target.range),
Vector3(pos.x-target.range,pos.y,pos.z + target.range),
Vector3(pos.x+target.range,pos.y,pos.z + target.range),
Vector3(pos.x+target.range,pos.y,pos.z-target.range)];
Handles.DrawSolidRectangleWithOutline(verts, Color(1,1,1,0.2), Color(0,0,0,1));
for(var posCube : Vector3 in verts)
target.range = Handles.ScaleValueHandle(target.range,
posCube,
Quaternion.identity,
1,
Handles.CubeCap,
1);
}
}
And the script attached to this Handle:
该脚本附加到这个控制柄物体:
//SolidRectangleExample.js
var range : float = 5;
最后修改:2011年7月9日 Saturday 12:04