Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: galuodo on June 19, 2013, 09:27:58 PM

Title: Mouse events have different effect after update Unity 3D
Post by: galuodo on June 19, 2013, 09:27:58 PM
We former used Unity3D var 4.0.1, and game runs well, however after update to 4.1.3 or 4.1.5, we have a trouble.

Our project contains ngui and ex2d plugin, and ngui has it's own layer.

I have attached collides in order to screen the mouse event -- if i click a gui window, the player won't move. But now, when I click the window, not only the button change the sprite, but also the player moved. So I want to know how to solve this problem :)
Title: Re: Mouse events have different effect after update Unity 3D
Post by: ArenMook on June 20, 2013, 07:29:15 AM
Did you update NGUI? Because NGUI isn't compatible with 4.0, and hasn't been for a while... which suggests to me that you have an old version of it and need to update.
Title: Re: Mouse events have different effect after update Unity 3D
Post by: galuodo on June 20, 2013, 10:14:53 PM
yes I have upgraded to 2.6.2.
Title: Re: Mouse events have different effect after update Unity 3D
Post by: ArenMook on June 21, 2013, 05:19:57 AM
So how do you move your player? NGUI won't intercept Input-based events. NGUI will only intercept events that use its system -- OnPress instead of OnMouse* for example.
Title: Re: Mouse events have different effect after update Unity 3D
Post by: galuodo on June 23, 2013, 09:28:36 PM
So how do you move your player? NGUI won't intercept Input-based events. NGUI will only intercept events that use its system -- OnPress instead of OnMouse* for example.

we use ngui to create gui, and other moving is used ex2d. the scene have a script which processes OnMouseDown  event to let player move
Title: Re: Mouse events have different effect after update Unity 3D
Post by: ArenMook on June 24, 2013, 10:20:38 AM
And in there lies your problem. OnMouse* series of events are Unity events that NGUI has no control over. It can't intercept what it has no control over.

You need to switch to NGUI events fully.