Author Topic: Making OnPress fire false when leaving the collider bounds  (Read 3705 times)

Fordeka

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 20
    • View Profile
Making OnPress fire false when leaving the collider bounds
« on: August 07, 2012, 11:33:57 AM »
Hi Aren,

I need to have buttons that release if you touch and drag outside the bounds of the button's collider, can you suggest a good way to achieve this behavior without seriously tangling up NGUI?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Making OnPress fire false when leaving the collider bounds
« Reply #1 on: August 07, 2012, 12:36:21 PM »
You can cancel the effect's visual component by sending SendMessage("OnPress", false) to the highlighted button. You can check to see what's under the mouse in your update function by checking UICamera.lastHit.collider.