Author Topic: Bug in UICamera / ProcessFakeTouches  (Read 3279 times)

Cabal

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 16
    • View Profile
Bug in UICamera / ProcessFakeTouches
« on: January 16, 2014, 10:01:31 AM »
Hi,

Looking at ProcessFakeTouches in UICamera.cs, we had to make one small change for the mouse to work.
In the if statement, when it sets the current touch to mMouse[0], it currently sets the currentTouchID to 1.

Looking at the comments at the top of the file, the touch ID to use for the left mouse button is -1.

We changed the line from:
  1. currentTouchID = 1;
to
  1. currentTouchID = -1;
and things started working as expected.

If this fix is correct, could it be rolled in the next version of NGUI?
Hope this helps somebody else :)

Thanks!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Bug in UICamera / ProcessFakeTouches
« Reply #1 on: January 16, 2014, 11:32:44 PM »
It's intentional. It simulates touch events using a mouse, so '1' implies 'first touch'. It shouldn't be using mouse IDs.