Beispiel #1
0
        public float drawSlider(bool under, ref float value)
        {
            GUILayout.Label(title + value + units, SCANskins.SCAN_whiteReadoutLabel);

            Rect r = GUILayoutUtility.GetLastRect();

            r.x    += 110;
            r.width = 260;

            if (under)
            {
                GUI.HorizontalSlider(r, value, minValue, maxValue).Mathf_Round(precision);
            }
            else
            {
                value = GUI.HorizontalSlider(r, value, minValue, maxValue).Mathf_Round(precision);
            }

            int    i = precision <= 0 ? 0 : precision;
            string labelPrecision = "F" + i.ToString();

            SCANuiUtil.drawSliderLabel(r, minValue.ToString(labelPrecision) + units, maxValue.ToString(labelPrecision) + units);

            currentValue = value;

            return(value);
        }