Version: 2021.1
言語: 日本語
public static float VerticalSlider (Rect position, float value, float topValue, float bottomValue);
public static float VerticalSlider (Rect position, float value, float topValue, float bottomValue, GUIStyle slider, GUIStyle thumb);

パラメーター

position 表示位置
value 現在値
topValue スライダーの上端の値
bottomValue スライダーの下端の値
slider ドラッグする領域を表示するために使用する GUIStyle。省略された場合は、現在の GUISkin にある horizontalSlider スタイルを使用します。
thumb ドラッグするつまみを表示するために使用する GUIStyle。省略された場合は、現在の GUISkin にある horizontalSliderThumb スタイルを使用します。

戻り値

float ユーザーによって設定された値

説明

ユーザーが最小値と最大値の間で値をドラッグで変更できる垂直スライダー

// Draws a vertical slider control that goes from  10 (top) to 0 (bottom)

using UnityEngine; using System.Collections;

public class ExampleClass : MonoBehaviour { public float vSliderValue = 0.0f;

void OnGUI() { vSliderValue = GUI.VerticalSlider(new Rect(25, 25, 100, 30), vSliderValue, 10.0f, 0.0f); } }