EditorGUILayout.Slider 滑动条

static function Slider (value : float, leftValue : float, rightValue : float, params options : GUILayoutOption[]) : float
static function Slider (label : string, value : float, leftValue : float, rightValue : float, params options : GUILayoutOption[]) : float
static function Slider (label : GUIContent, value : float, leftValue : float, rightValue : float, params options : GUILayoutOption[]) : float

Parameters参数

Returns

float - The value that has been set by the user.

返回浮点数,由用户设置的值。

Description描述

Make a slider the user can drag to change a value between a min and a max.

制作一个滑动条用户可以拖动来改变值,在最小和最大值之间。

EditorGUILayout.Slider 滑动条

Scale the selected object between a range.
在一个范围缩放选择的物体。

// Editor script that lets you scale the selected GameObject between 1 and 100
//缩放选择的游戏物体,在1-100之间
class EditorGUILayoutSlider extends EditorWindow {

	var scale : float = 0.0;

	@MenuItem("Examples/Editor GUILayout Slider usage")
	static function Init() {
		var window = GetWindow(EditorGUILayoutSlider);
		window.Show();
	}

	function OnGUI() {
		scale = EditorGUILayout.Slider(scale,1, 100);
	}
	function OnInspectorUpdate() {
		if(Selection.activeTransform)
			Selection.activeTransform.localScale = Vector3(scale, scale, scale);
	}
}

static function Slider (property : SerializedProperty, leftValue : float, rightValue : float, params options : GUILayoutOption[]) : void
static function Slider (property : SerializedProperty, leftValue : float, rightValue : float, label : string, params options : GUILayoutOption[]) : void
static function Slider (property : SerializedProperty, leftValue : float, rightValue : float, label : GUIContent, params options : GUILayoutOption[]) : void

Parameters参数

Description描述

Make a slider the user can drag to change a value between a min and a max.

制作一个滑动条用户可以拖动来改变值,在最小和最大值之间。

Page last updated: 2011-7-13