Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: 3d03 on January 22, 2014, 05:03:24 PM

Title: UISlider: How to get index of current step (if Steps is more than 0)?
Post by: 3d03 on January 22, 2014, 05:03:24 PM
I'm trying to get current step index, but it's difficult because of float-to-int, float-div-float math.round-float issues.
Please help.

sorry for my english.


Title: Re: UISlider: How to get index of current step (if Steps is more than 0)?
Post by: 3d03 on January 22, 2014, 05:51:41 PM
Yes! I did it!)

index = (int) Mathf.Lerp (1, slider.numberOfSteps,slider.value);
Title: Re: UISlider: How to get index of current step (if Steps is more than 0)?
Post by: Anadin on May 29, 2014, 09:23:46 PM
Super Useful - thanks!