Author Topic: Stop touches propogating OnClick()  (Read 1222 times)

honohanf

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Stop touches propogating OnClick()
« on: May 13, 2014, 12:47:18 PM »
I'm using Prime31's Touchkit for swipe & screen area tap recognition, and I've then got a few NGUI buttons overlayed.

Obviously I've got the Touchkit script running after UICamera in the script execution order, but touches still propogate down even if they spark OnClicks from the buttons.

Is there a quick way of stopping these touches getting past NGUI, or do I need to couple the classes (ugly) with some lock booleans etc?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Stop touches propogating OnClick()
« Reply #1 on: May 14, 2014, 05:39:57 AM »
There is no way to "cancel" Input events in Unity. All scripts get them. This is why NGUI has its own event system running on top of the input events. All I can suggest is modify the prime's plugin to use NGUI's events instead of Input events, or check with Mike to see if he knows of anyone who has done it at any point.