GUILayout.VerticalSlider 垂直滑动条

static function VerticalSlider (value : float, topValue : float, bottomValue : float, params options : GUILayoutOption[]) : float
static function VerticalSlider (value : float, topValue : float, bottomValue : float, slider : GUIStyle, thumb : GUIStyle, params options : GUILayoutOption[]) : float

Parameters参数

Returns

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

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

Description描述

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

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

GUILayout.VerticalSlider 垂直滑动条

Vertical slider in the Game View.
在游戏视图中的垂直滑动条。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public float vSliderValue = 0.0F;
	void OnGUI() {
		vSliderValue = GUILayout.VerticalSlider(vSliderValue, 10.0F, 0.0F);
	}
}
// Draws a vertical slider control that goes from 10 (top) to 0 (bottom)
//绘制一个垂直滑动条控件,值从10.0~0

var vSliderValue : float = 0.0;

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