Author Topic: Unity 4.1 and OnMouseEnter  (Read 5389 times)

ART_Adventures

  • Guest
Unity 4.1 and OnMouseEnter
« on: March 18, 2013, 06:35:13 AM »
Hello People,

When using NGUI on the latest Unity 4.1, I notice that none of my objects can receive an OnMouseEnter event when a UICamera component is attached to the camera. If I remove the UICamera component from my camera, then I can receive OnMouseEnter.

Can anybody help regarding this.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Unity 4.1 and OnMouseEnter
« Reply #1 on: March 18, 2013, 03:28:58 PM »
UICamera removes it by setting eventMask to 0.

I seriously advise you to reconsider using OnMouseEnter. Replace it with OnHover that NGUI uses. OnMouseEnter is Unity's functionality that will be deprecated in Unity 4.3.

ART_Adventures

  • Guest
Re: Unity 4.1 and OnMouseEnter
« Reply #2 on: March 19, 2013, 07:24:05 AM »
Thanks for the info. I was not aware that this feature was schedule to be deprecated. Just curious then, what will come to replace OnMouseEnter?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Unity 4.1 and OnMouseEnter
« Reply #3 on: March 19, 2013, 07:26:08 AM »
OnMouseEnterEvent() / OnMouseExitEvent(). They are a part of a unified event system that will replace the old functionality.