Welcome,
Guest
. Please
login
or
register
.
December 06, 2024, 03:34:44 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
UISlider: How to get index of current step (if Steps is more than 0)?
« previous
next »
Print
Pages: [
1
]
Author
Topic: UISlider: How to get index of current step (if Steps is more than 0)? (Read 2530 times)
3d03
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 3
UISlider: How to get index of current step (if Steps is more than 0)?
«
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.
Logged
3d03
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 3
Re: UISlider: How to get index of current step (if Steps is more than 0)?
«
Reply #1 on:
January 22, 2014, 05:51:41 PM »
Yes! I did it!)
index = (int) Mathf.Lerp (1, slider.numberOfSteps,slider.value);
Logged
Anadin
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 9
Re: UISlider: How to get index of current step (if Steps is more than 0)?
«
Reply #2 on:
May 29, 2014, 09:23:46 PM »
Super Useful - thanks!
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
UISlider: How to get index of current step (if Steps is more than 0)?