Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: krzysieko on May 07, 2014, 10:36:38 AM

Title: [BUG] Adding UICamera script blocks mouse events (e.g. OnMouseDown)
Post by: krzysieko on May 07, 2014, 10:36:38 AM
I do not know if this is on purpose but, as in topic, UICamera blocks OnMouse* events. Solution is to replace lines 934-949 with line 948 alone (or change #ifdef condition).

If this is a bug, you should add checkbox to UICamera to choose behaviour.
If this is not a bug, I suppose it may be because you thought that UNITY_4_0 covers all 4.x versions (which is not true).
Title: Re: [BUG] Adding UICamera script blocks mouse events (e.g. OnMouseDown)
Post by: ArenMook on May 08, 2014, 01:32:58 AM
This is NOT a bug.

OnMouse events should not be used. Ever. In fact they get completely removed in a future version of Unity.

They are ridiculously slow, slowing down your app for no reason because it has to perform a raycast into the entire scene. If that's not bad enough, what's the point of using them when NGUI already gives you a much more robust event framework to work with?

Instead of OnMouseOver use OnHover(bool isOver). Check UICamera's documentation page.