Author Topic: Disabled button passes through click events  (Read 3660 times)

zenmaster

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 20
    • View Profile
Disabled button passes through click events
« on: March 31, 2014, 02:24:21 PM »
Hi All,

I'm using the following code to disable UIButtons.
button.isEnabled = false;

If you click on the disable button, the event goes through and hits a collider below it.
Is this the correct way to disable a button?

Thanks.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Disabled button passes through click events
« Reply #1 on: April 01, 2014, 07:33:12 AM »
When you disable a button via isEnabled you effectively turn off its collider as well, so yes the events will go to the next collider in line -- something below it, like the window's background. This is obvious, no? What are you trying to do?