Minmax slider on Unity 4.6?

Hello,

I’m currently testing few things on Unity’s new UI system and I was surprised that it seems to have no MinMax Slider.
So here are my questions:

  1. If there is a simple way to create that, I would love to know about it :slight_smile:

  2. If not: Is there is someone that already tried to do it? I was thinking about create a script that inherit from Slider script and modify all behavior but that seems painfull and public member doesn’t seems to appear in Editor :confused:

Does anyone have a solution? :slight_smile:

Otherwise, I think it will be fine with InputField, thanks!

Under Slider there are two variables called Min Value and Max Value that you can set to make it a MinMax Slider with your specified values.

Hi, in case anyone needs a Min-Max slider in Unity 5, here’s one I made: GitHub - jmcorallo/unity-ui-elements: A collection of useful UI elements that are not included in Unity's UI

You can download the .unitypackage (version 0.1) directly here: https://github.com/jmcorallo/unity-ui-elements/releases/download/v0.1/UnityUiElements_v0_1.unitypackage

Hello,

Code like this:

public class NewGUI : MonoBehaviour {
     public float min, max;
     //public const float minLimit, maxLimit;

     void OnGUI () {
          EditorGUILayout.MinMaxSlider (ref min, ref max, minLimit, maxLimit);

          //min and max will now store the returning value of the use
     }

}