Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: zentuit on July 03, 2012, 02:10:28 PM
-
I'm having an issue with using UISliders as health bars. Each unit gets a UISlider attached when spawned. However if the spawn point is out of the visible camera, then the foreground widget pops up in the middle of the screen.
My code is an extension of http://www.tasharen.com/?topic=creating-a-ui-sprite-on-the-fly.
The cause is that the UISlider Start calls Set which in turn enables the FGWidget.
Anyone know how to hook in and reset the enabled flag after the UISlider Start call?
-
Just disable the UISlider script if it's off-screen.
-
Doh, UISlider isn't a UIWidget.
I'm fixed now, thanks.