Author Topic: Can function OnClick reponse different overlaped colliders  (Read 2055 times)

galuodo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 65
    • View Profile
Can function OnClick reponse different overlaped colliders
« on: March 04, 2013, 05:10:29 AM »
I am working on a chat window, and have many buttons and labels which has different scripts. However, after finished these functions, i was asked to set the whole background visible when curse into the whole window. So the first solution came into my mind is to attach a large collider in order to set the visible, but after response this event, others will not be responded. So how can I set this big collider so that other colliders under (have a large z axis) are able to receive mouse events. thanks:)
and forgive my pool English, please :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Can function OnClick reponse different overlaped colliders
« Reply #1 on: March 04, 2013, 12:07:26 PM »
Put a UIForwardEvents on the collider you don't want to receive anything and have it forward evens elsewhere.

galuodo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 65
    • View Profile
Re: Can function OnClick reponse different overlaped colliders
« Reply #2 on: March 04, 2013, 09:01:48 PM »
Thank you.
UIForwardEvents is very convenient and thoughtful, however I have too many targets to forward, and I have to bound too many targets...... and modify the window will not easy.
I will use update() to detect whether the pointer is in the certain area. And forward events can be used in latter works~~