Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Mickman on April 18, 2013, 06:08:24 AM
Title:
Change UISlider value from 1f to 100 (int) ?
Post by:
Mickman
on
April 18, 2013, 06:08:24 AM
Hi,
How to change ProgressBar Value to int 100 ? ( current max = 1.0f )
Title:
Re: Change Progress Bar value when pick up item [SOLVED]
Post by:
ArenMook
on
April 18, 2013, 05:49:53 PM
float myValue = Mathf.Lerp(0, 100, slider.sliderValue);
Title:
Re: Change Progress Bar value when pick up item [SOLVED]
Post by:
Mickman
on
April 18, 2013, 05:58:00 PM
thx so much for the snippet of magic
public float myValue = Mathf.Lerp(0, 100, slider.sliderValue);
I'm not sure about "
slider
.sliderValue); "
Is this supposed to be the name I gave to the script I created that changes the values ?
If so ... I called it SliderValueChange.cs
public
class
SliderValueChange
:
MonoBehaviour
{
public
UISlider progBar
;
public
Inventory sphereItem
;
public
float
curValue
;
void
Update
(
)
{
OnSliderChange
(
)
;
}
void
OnSliderChange
(
)
{
progBar
.
sliderValue
=
curValue
;
curValue
=
Inventory
.
score
;
}
}
not sure where to fit the given code... ??