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参数

  • label
    Optional label in front of the toggle. // 开关按钮前面的可选标签。
  • value
    The value to edit. // 编辑的值
  • leftValue
    The value at the left end of the slider.
       滑动条最左边的值
  • rightValue
    The value at the right end of the slider.
       滑动条最右边的值
  • options
    An optional list of layout options that specify extra layouting   properties. Any values passed in here will override settings defined by   the style.  See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight
       指定额外布局属性的可选列表。这里传递任意值,将覆盖样式定义的设置。

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参数

  • label
    Optional label in front of the toggle. // 开关按钮前面的可选标签。
  • property
    The value the slider shows. This determines the position of the draggable thumb.
       显示滑动条的值,可拖动滑块确定的位置。
  • leftValue
    The value at the left end of the slider.
       滑动条最左边的值
  • rightValue
    The value at the right end of the slider.
       滑动条最右边的值
  • options
    An optional list of layout options that specify extra layouting   properties. Any values passed in here will override settings defined by   the style.  See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight
       指定额外布局属性的可选列表。这里传递任意值,将覆盖样式定义的设置。

Description描述

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

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


,