76
NGUI 3 Support / Re: Getting current position in Slider?
« on: April 27, 2014, 10:23:09 AM »
Make a new script, put this code into it ( In this case the file named : MyTestScript_1 ) :
Drag that script into the Slider object .
Drag the slider object from the hierarchy tab to the slider_1 value which shows in the Inspector (Because it declared as public ) .
Play the scene and it will print the value of it while you play in it every frame .
- using UnityEngine;
- using System.Collections;
- public class MyTestScript_1 : MonoBehaviour {
- public UISlider slider_1 ;
- void Update ()
- {
- print (slider_1.sliderValue);
- }
- }
Drag that script into the Slider object .
Drag the slider object from the hierarchy tab to the slider_1 value which shows in the Inspector (Because it declared as public ) .
Play the scene and it will print the value of it while you play in it every frame .