I am using the UI slider from Unity 5 and would like to display a text every time the handle knob is touched/pressed.
My understanding is that my script should extend some Event System interface. From the unity doc either ISelectHandler or IPointDownHandler should be able to 'hear' if my knob is pressed. I am a noobie to the unity event system, so I hope that this question doesn't offend anyone if its pretty basic..
So far this is what I have:
public class SliderControl : MonoBehaviour, ISelectHandler {
public Slider slider;
void Start(){
slider.transform.GetChild (2); // this gets the Handle Slide Area where the knob is
}
public void OnSelect (BaseEventData eventData) {
Debug.Log ("Display some text");
}
}
My questions are:
What exactly is a base event data in simple English?
How can I convert my slider knob into a BaseEventData type that OnSelect() can work with?
