Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: ryanscottmurphy on January 19, 2014, 06:49:02 PM

Title: OnDragOver event?
Post by: ryanscottmurphy on January 19, 2014, 06:49:02 PM
Is there an "NGUI way" to deliver information about the UIDragDropItem that is being held over a UIDragDropContainer?

I'm in a situation where I'd like to grab a handle to the GameObject and check what's being dragged over a container before deciding how the container should react in response. It seems like it might be a pretty common so I'm curious if NGUI might have a technique for handling this.

I should mention, I realize that there's an OnDrop(GameObject) message - but I'm looking for information about something before it's dropped. (In other words, when it's entering and exiting a container).
Title: Re: OnDragOver event?
Post by: sintua on January 19, 2014, 07:10:20 PM
I think some combination of OnHover for your container and tracking which object's OnPress started the drag should take care of that?
Title: Re: OnDragOver event?
Post by: ArenMook on January 19, 2014, 11:30:59 PM
UICamera.currentTouch.dragged tells you what's being dragged inside any NGUI event.
Title: Re: OnDragOver event?
Post by: ryanscottmurphy on January 21, 2014, 05:57:20 PM
Thanks to both of you! A combination of UICamera.currentTouch.dragged and OnHover() is exactly what I was looking for.