1
NGUI 3 Support / Any way to tell if a UISlider is currently being dragged?
« on: October 13, 2015, 01:28:52 PM »
Hiya! NGUI's a lifesaver!
I'm building a scene with camera movement where the user can click and drag the mouse to rotate the camera. I've got it so when the mouse cursor is hovering above a UI collider it'll disable camera movement, but I'm having an issue with sliders. When you click and drag a slider, the cursor can move off the slider's collider area, therefore the camera's movement is allowed again even though the user is still dragging my UIScrollView's slider.
Do you have a technique I could use to check if a slider is in use? I've tried simply checking if UISlider.current != null, but that doesn't seem to be working. UISlider.current.isActiveAndEnabled doesn't work either, but I'm not 100% certain of the purpose of that bool so I didn't expect it to work in the first place. The slider is attached to a UIScrollView, so maybe I could check if that scroll view is being moved? I'm not sure how I'd do that.
Thanks for any advice you could give! Currently using NGUI 3.8.2.
I'm building a scene with camera movement where the user can click and drag the mouse to rotate the camera. I've got it so when the mouse cursor is hovering above a UI collider it'll disable camera movement, but I'm having an issue with sliders. When you click and drag a slider, the cursor can move off the slider's collider area, therefore the camera's movement is allowed again even though the user is still dragging my UIScrollView's slider.
Do you have a technique I could use to check if a slider is in use? I've tried simply checking if UISlider.current != null, but that doesn't seem to be working. UISlider.current.isActiveAndEnabled doesn't work either, but I'm not 100% certain of the purpose of that bool so I didn't expect it to work in the first place. The slider is attached to a UIScrollView, so maybe I could check if that scroll view is being moved? I'm not sure how I'd do that.
Thanks for any advice you could give! Currently using NGUI 3.8.2.