Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: wouter on May 08, 2014, 11:09:49 AM

Title: drag & drop notification
Post 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?
Title: Re: drag & drop notification
Post by: ArenMook on May 09, 2014, 05:26:20 AM
OnDragStart?
Title: Re: drag & drop notification
Post by: wouter on May 09, 2014, 06:02:28 AM
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?
Title: Re: drag & drop notification
Post by: ArenMook on May 09, 2014, 06:18:34 AM
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.