Author Topic: OnHover and OnDrag  (Read 5642 times)

EToreo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 88
    • View Profile
OnHover and OnDrag
« on: January 21, 2013, 03:11:10 AM »
I have an object (UISlicedSprite) that will be receiving drop events from a DragDropItem.  It has a DragDropSurface script and I am trying to augment the script to also play any Tweens on the same object.  To do this I created a "OnHover" function, but this function only gets called when the object is being hovered without a mouse down (that came from a different collider).

Is there a way to get the effect I want?  What callbacks should I be using instead?

Thanks!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: OnHover and OnDrag
« Reply #1 on: January 21, 2013, 07:33:49 AM »
UICamera.stickyPress = false.

EToreo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 88
    • View Profile
Re: OnHover and OnDrag
« Reply #2 on: January 22, 2013, 12:14:59 AM »
Setting this option causes my DragDropItem's to not drag at all - or if they do, they are immediately "dropped".  It also didn't seem to fix the original issue...

Any more ideas?

Thanks for the help.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: OnHover and OnDrag
« Reply #3 on: January 22, 2013, 10:27:01 AM »
Alright you must have to have your dragged item keep an eye on what's underneath it (check UICamera.hoveredObject in OnDrag) and react accordingly.

EToreo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 88
    • View Profile
Re: OnHover and OnDrag
« Reply #4 on: January 22, 2013, 10:36:50 PM »
Works like a charm, thanks!