center | 圆盘的中心。 |
normal | 圆盘的法线。 |
radius | 圆盘的半径。 注意:如果您希望拥有恒定屏幕大小的手柄,请使用 HandleUtility.GetHandleSize。 |
在 3D 空间中绘制一个实心平面圆盘。
Solid Disc in the Scene View.
// Create a semi transparent white disc with a ScaleValueHandle attached to the disc
// that lets you modify the "areaOfEffect" var in the WireDiscExample.js
@CustomEditor (SolidDiscExample)
class DrawSolidDisc extends Editor {
function OnSceneGUI () {
Handles.color = Color(1,0,0,0.1);
Handles.DrawSolidDisc(target.transform.position, Vector3.up, target.areaOfEffect);
Handles.color = Color.red;
target.areaOfEffect =
Handles.ScaleValueHandle(target.areaOfEffect,
target.transform.position + Vector3(target.areaOfEffect,0,0),
Quaternion.identity,
2,
Handles.CylinderCap,
2);
}
}
附加到此手柄的脚本:
//SolidDiscExample.js
var areaOfEffect : float = 5;