お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Closeposition | スライダーを描画するスクリーン上のRect |
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) var vSliderValue : float = 0.0; function OnGUI () { vSliderValue = GUI.VerticalSlider (Rect (25, 25, 100, 30), vSliderValue, 10.0, 0.0); }
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); } }
import UnityEngine import System.Collections public class ExampleClass(MonoBehaviour): public vSliderValue as float = 0.0F def OnGUI() as void: vSliderValue = GUI.VerticalSlider(Rect(25, 25, 100, 30), vSliderValue, 10.0F, 0.0F)