Version: 5.6
Obsolete public static void MinMaxSlider (GUIContent label, Rect position, ref float minValue, ref float maxValue, float minLimit, float maxLimit);
public static void MinMaxSlider (Rect position, ref float minValue, ref float maxValue, float minLimit, float maxLimit);
public static void MinMaxSlider (Rect position, string label, ref float minValue, ref float maxValue, float minLimit, float maxLimit);
public static void MinMaxSlider (Rect position, GUIContent label, ref float minValue, ref float maxValue, float minLimit, float maxLimit);

パラメーター

position 表示位置
label スライダーの前のオプションのラベル
minValue スライダーが示す範囲の下限の値はレファレンスから渡されます。
maxValue スライダーが示す範囲の上限の値はレファレンスから渡されます。
minLimit 最小値
maxLimit 最大値

説明

ユーザーが最小と最大の間の範囲を指定して使用できる特別なスライダーを作成します。


MinMax Slider in an Editor Window.

// Place the selected object randomly between the interval of the Min Max Slider
// in the X,Y,Z coords

class EditorGUIMinMaxSlider extends EditorWindow {

var minVal : float = -10; var minLimit : float = -20; var maxVal : float = 10; var maxLimit : float = 20;

@MenuItem("Examples/Editor GUI Move Object Randomly") static function Init() { var window = GetWindow(EditorGUIMinMaxSlider); window.Show(); }

function OnGUI() { EditorGUI.MinMaxSlider( Rect(0,0,position.width,20), GUIContent("Random range:"), minVal, maxVal, minLimit, maxLimit); if(GUI.Button(Rect(0,25,position.width, position.height -25),"Randomize!")) PlaceRandomly(); }

function PlaceRandomly() { if(Selection.activeTransform) Selection.activeTransform.position = Vector3(Random.Range(minVal, maxVal), Random.Range(minVal, maxVal), Random.Range(minVal, maxVal)); else Debug.LogError("Select a GameObject to randomize its position."); } }