Author Topic: OnClick events also trigger OnHover?  (Read 2105 times)

Neverdyne

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
OnClick events also trigger OnHover?
« on: June 22, 2014, 11:42:21 AM »
Hello,

I've noticed that when clicking an object, this sends both the OnHover and OnClick events to it. Why is this so? Is there a way to get OnHover events only when the mouse enters or leaves the collider, and not when while inside the collider a click happens?

Thanks!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: OnClick events also trigger OnHover?
« Reply #1 on: June 22, 2014, 11:29:44 PM »
The sequence of events is:

OnHover(true)->OnPress(true)->OnPress(false)->OnHover(true)->OnClick()

This is how the OnHover(true) state is restored, for things like button highlighting.