Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started 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).
-
I think some combination of OnHover for your container and tracking which object's OnPress started the drag should take care of that?
-
UICamera.currentTouch.dragged tells you what's being dragged inside any NGUI event.
-
Thanks to both of you! A combination of UICamera.currentTouch.dragged and OnHover() is exactly what I was looking for.