GUILayout.HorizontalSlider 水平滑动条

static function HorizontalSlider (value : float, leftValue : float, rightValue : float, params options : GUILayoutOption[]) : float
static function HorizontalSlider (value : float, leftValue : float, rightValue : float, slider : GUIStyle, thumb : GUIStyle, params options : GUILayoutOption[]) : float

Parameters参数

Returns

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

返回浮点型,已经由用户设置的值。

Description描述

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

创建一个水平滑动条,用户可以拖动改变在最小和最大值之间的值。

GUILayout.HorizontalSlider 水平滑动条

Horizontal slider in the GameView.
在游戏视图中的水平滑动条。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public float hSliderValue = 0.0F;
	void OnGUI() {
		hSliderValue = GUILayout.HorizontalSlider(hSliderValue, 0.0F, 10.0F);
	}
}
var hSliderValue : float = 0.0;

function OnGUI () {
	hSliderValue = GUILayout.HorizontalSlider (hSliderValue, 0.0, 10.0);
}
Page last updated: 2011-6-14