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.ScaleSlider 缩放滑动柄
static function ScaleSlider (scale : float, position : Vector3, direction : Vector3, rotation : Quaternion, size : float, snap : float) : float
Parameters参数
- scaleThe value the user can modify. // 用户可以修改的值
- positionThe position of the handle. //控制柄的位置
- directionThe direction of the handle. // 控制柄的方向
-
rotationThe rotation of whole object. // 整个对象的旋转
-
sizeThe size of the handle.
控制柄的大小 - snapThe new value after the user has modified it. Note: Use HandleUtility.GetHandleSize where you might want to have constant screen-sized handles.
用户修改后的新值。注意:使用HandleUtility.GetHandleSize你可能希望有恒定屏幕大小的控制柄
Description描述
Make a directional scale slider
制作一个方向性缩放滑动柄。
Scale slider handle in the Scene View.
在场景视图中的缩放滑动控制柄
// Increase/decrease a value just by moving the Scale slider Handle
//增加/减少一个值,仅通过移动缩放滑动手柄
@CustomEditor (FreeScale)
class FreeScaleHandleJS extends Editor {
function OnSceneGUI () {
target.val = Handles.ScaleSlider(target.val,
target.transform.position,
Vector3.up,
Quaternion.identity,
5,
HandleUtility.GetHandleSize(target.transform.position));
if (GUI.changed)
EditorUtility.SetDirty (target);
}
}
And the script attached to this Handle:
该脚本附加到这个控制柄物体:
// FreeScale.js
@script ExecuteInEditMode()
var val : float = 1;
function Update () {
Debug.Log("Value tied to the slider: " + val);
}
最后修改:2011年7月8日 Friday 12:08