Author Topic: OnDragOver event?  (Read 4671 times)

ryanscottmurphy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
OnDragOver event?
« 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).

sintua

  • Jr. Member
  • **
  • Thank You
  • -Given: 7
  • -Receive: 0
  • Posts: 63
    • View Profile
Re: OnDragOver event?
« Reply #1 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?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: OnDragOver event?
« Reply #2 on: January 19, 2014, 11:30:59 PM »
UICamera.currentTouch.dragged tells you what's being dragged inside any NGUI event.

ryanscottmurphy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: OnDragOver event?
« Reply #3 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.