Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: wouter on May 08, 2014, 11:09:49 AM
-
Using the UIDragDropItem Is there a way to be notified when dragging has started in case of restrictions?
Right now I can check if dragging has started using other logic, but since this is not always legal, some functions should only be run when it is "actually" dragged?
-
OnDragStart?
-
I get that, but how do you ONLY send the notification when it has moved horizontally?
onDragStart sends it when scrolling in the panel as well, I only want to be notified when it started dragging horizontally..
I con copy the code you use for that, but maybe there is a better way?
-
For something like that I'd record the position in OnDragStart, then check it in OnDrag (Vector2 delta). When the position has moved adequately far enough, I'd actually trigger the callback I want to be notified of this.
Basically don't rely on OnDragStart for this. Write some very simple logic instead.