Author Topic: Events not bubbling up properly  (Read 2010 times)

NeilM

  • Global Moderator
  • Newbie
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 7
  • Posts: 16
    • View Profile
Events not bubbling up properly
« on: December 08, 2014, 11:16:55 AM »
I'm having troubles getting a widget to receive click events and I was wondering if anyone could help out.

I have one full screen widget with a UIEventTrigger script on it.  The On Drag Out calls a function where I process swipes left and right.
Behind that, I have a Camera to my 3D scene.  That camera has a UICamera script on it set to 3D UI and Event Mask of "Player".
Inside the 3D scene, I have a gameobject with a layer set to "Player".  It has a UIEventTrigger script on it, that reacts to OnClick events.

Both the swipes and the clicks work well in isolation, but when I try to use the two together, the drag code appears to be eating the click events.  Is there any way I can get the click events to pass down to the lower camera?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Events not bubbling up properly
« Reply #1 on: December 09, 2014, 01:41:57 PM »
The collider that's in front will eat all events, that's how NGUI works. You can't selectively process only certain events while letting others fall through. uGUI works like that, but NGUI does not.

NeilM

  • Global Moderator
  • Newbie
  • *****
  • Thank You
  • -Given: 0
  • -Receive: 7
  • Posts: 16
    • View Profile
Re: Events not bubbling up properly
« Reply #2 on: December 10, 2014, 09:03:37 AM »
Ok.  I've hacked around it by putting an invisible rectangle over top that detects clicks first.  It's not ideal, but "good enough.".