Welcome,
Guest
. Please
login
or
register
.
October 03, 2024, 09:47:40 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Can you set a Slider value with UISlider.current.value
« previous
next »
Print
Pages: [
1
]
Author
Topic: Can you set a Slider value with UISlider.current.value (Read 2191 times)
capitalj
Jr. Member
Thank You
-Given: 5
-Receive: 0
Posts: 88
Can you set a Slider value with UISlider.current.value
«
on:
February 17, 2014, 12:32:36 AM »
Hi,
I'm using a UISlider and wanted to know if it was possible to set the value using UISlider.current.value? I tried doing this:
UISlider.current.value = 0.5;
but got a null reference. This is with the slider visible and interacted with.
-JJ
Logged
BehindTheStone
Full Member
Thank You
-Given: 0
-Receive: 0
Posts: 135
Re: Can you set a Slider value with UISlider.current.value
«
Reply #1 on:
February 17, 2014, 04:24:52 AM »
Well, you just could reference the Slider, like this:
UISlider m_slider
;
void
Start
(
)
{
m_slider
=
GetComponent
<
UISlider
>
(
)
;
m_slider
.
value
=
0
.
5f
;
}
Logged
capitalj
Jr. Member
Thank You
-Given: 5
-Receive: 0
Posts: 88
Re: Can you set a Slider value with UISlider.current.value
«
Reply #2 on:
February 17, 2014, 01:58:48 PM »
Thanks. I'll probably just do the reference, but was wondering if there was a way to do it without.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Can you set a Slider value with UISlider.current.value