using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Linq;

public class SliderWithLabels : Slider
{
    private Text valueLabel;

    new void Awake()
    {
        base.Awake();
        valueLabel = GetComponentsInChildren<Text>().Last();
        value = value;
    }

    public override float value
    {
        get { return base.value; }
        set
        {
            base.value = value;
            valueLabel.text = (wholeNumbers ? Mathf.RoundToInt(value) : value).ToString();
        }
    }
}
