Author Topic: Mouse events have different effect after update Unity 3D  (Read 4106 times)

galuodo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 65
    • View Profile
Mouse events have different effect after update Unity 3D
« 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 :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Mouse events have different effect after update Unity 3D
« Reply #1 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.

galuodo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 65
    • View Profile
Re: Mouse events have different effect after update Unity 3D
« Reply #2 on: June 20, 2013, 10:14:53 PM »
yes I have upgraded to 2.6.2.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Mouse events have different effect after update Unity 3D
« Reply #3 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.

galuodo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 65
    • View Profile
Re: Mouse events have different effect after update Unity 3D
« Reply #4 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

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Mouse events have different effect after update Unity 3D
« Reply #5 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.