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.RadiusHandle 半径控制柄
static function RadiusHandle (rotation : Quaternion, position : Vector3, radius : float, handlesOnly : bool) : float
static function RadiusHandle (rotation : Quaternion, position : Vector3, radius : float) : float
Parameters参数
- positionCenter of the handle in 3D space
在3D空间,控制柄的中心 -
rotationOrientation of the handle // 控制柄的方向
-
radiusRadius to modify // 修改半径
float - the modified radius Note: Use HandleUtility.GetHandleSize where you might want to have constant screen-sized handles.
返回浮点值,修改的半径。注意:使用Use HandleUtility.GetHandleSize你可能希望有恒定屏幕大小的控制柄。
Description描述
Make a Scene view radius handle
创建一个场景视图半径控制柄。
This will behave like the built-in scale tool
这行为就像内置的缩放工具。
RadiusHandle on the Scene View.
场景视图中的半径控制器
// Simple script that draws and controls a float var on any Game Object that has the
// ColliderRadius.js script attached.
//绘制并控制在任意游戏物体上,带有ColliderRadius.js的浮点变量。
@CustomEditor (ColliderRadius)
class RadiusHandleJS extends Editor {
function OnSceneGUI () {
target.areaOfEffect = Handles.RadiusHandle (Quaternion.identity,
target.transform.position,
target.areaOfEffect);
if (GUI.changed)
EditorUtility.SetDirty (target);
}
}
And the Script attached to this handle:
该脚本附加到这个控制柄物体:
// Place this script where you want to see the RadiusHandler working on.
//放置这个脚本到你想看到半径控制器的物体。
var areaOfEffect : float = 1;
最后修改:2011年7月7日 Thursday 13:50