UnityEditor.EditorGUILayout.IntSlider C# (CSharp) Method

IntSlider() public static method

Make a slider the user can drag to change an integer value between a min and a max.

public static IntSlider ( GUIContent label, int value, int leftValue, int rightValue ) : int
label UnityEngine.GUIContent Optional label in front of the slider.
value int The value the slider shows. This determines the position of the draggable thumb.
leftValue int The value at the left end of the slider.
rightValue int The value at the right end of the slider.
return int
        public static int IntSlider(GUIContent label, int value, int leftValue, int rightValue, params GUILayoutOption[] options)
        {
            Rect position = s_LastRect = GetSliderRect(true, options);
            return EditorGUI.IntSlider(position, label, value, leftValue, rightValue);
        }

Same methods

EditorGUILayout::IntSlider ( int value, int leftValue, int rightValue ) : int
EditorGUILayout::IntSlider ( string label, int value, int leftValue, int rightValue ) : int
EditorGUILayout::IntSlider ( UnityEditor.SerializedProperty property, int leftValue, int rightValue ) : void
EditorGUILayout::IntSlider ( UnityEditor.SerializedProperty property, int leftValue, int rightValue, GUIContent label ) : void
EditorGUILayout::IntSlider ( UnityEditor.SerializedProperty property, int leftValue, int rightValue, string label ) : void

Usage Example

Beispiel #1
0
    public override void OnEditorGui()
    {
        if (gui.Button("InitLevel"))
        {
            foreach (var a in  level.GetComponentsInChildren <AnimHelper>())
            {
                a.Init();
            }
        }
        prefabs  = transform.Find("tools").Cast <Transform>().ToArray();
        prefabst = prefabs.Select(a => a.name).ToArray();

        gridSize = GUI.IntSlider("GridSize", gridSize, 1, 10);
        PlanePos = GUI.IntSlider("PlanePos", PlanePos, -10, 10);

        tool = (Tool)gui.SelectionGrid((int)tool, Enum.GetNames(typeof(Tool)), 2);
        if (tool != oldtool)
        {
            //Debug.Log("Chagne");
            SelectedPrefab.gameObject.active = false;
        }
        oldtool = tool;
        //oldtooli = tooli;
        prefabsi = gui.SelectionGrid(prefabsi, prefabst, 2);
        base.OnEditorGui();
    }
All Usage Examples Of UnityEditor.EditorGUILayout::IntSlider