Author Topic: UICamera.touchCount inconsistent between Editor and Mobile Device  (Read 4754 times)

yuewah

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 180
    • View Profile
1. Press UIButton, UICamera.touchCount = 1 ( Editor ), 1 (Device )
2. Press In Empty Area, UICamera.touchCount = 0 ( Editor ), 1 ( Device )

yuewah

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 180
    • View Profile
Re: UICamera.touchCount inconsistent between Editor and Mobile Device
« Reply #1 on: June 14, 2013, 03:40:48 AM »
It would be a fix for UICamera.cs
  1.         static public int touchCount
  2.         {
  3.                 get
  4.                 {
  5.                         int count = 0;
  6.                        
  7.                         for (int j = 0; j < mTouches.Count; ++j)
  8.                                 if ( mTouches[j].pressed != null )
  9.                                         ++count;
  10.                        
  11.                         for (int i = 0; i < mMouse.Length; ++i)
  12.                                 if (mMouse[i].pressed != null)
  13.                                         ++count;
  14.  
  15.                         if (mController.pressed != null)
  16.                                 ++count;
  17.  
  18.                         return count;
  19.                 }
  20.         }
  21.  

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UICamera.touchCount inconsistent between Editor and Mobile Device
« Reply #2 on: June 14, 2013, 05:15:26 PM »
Fair enough, I will add this in, thanks.

yuewah

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 180
    • View Profile
Re: UICamera.touchCount inconsistent between Editor and Mobile Device
« Reply #3 on: June 17, 2013, 09:41:39 PM »
Could you add the following properties in UICamera.cs ?

  1.         static public int dragCount
  2.         {
  3.                 get
  4.                 {
  5.                         int count = 0;
  6.                        
  7.                         for (int j = 0; j < mTouches.Count; ++j)
  8.                         {
  9.                                 if ( mTouches[j].dragged != null )
  10.                                         ++count;
  11.                         }
  12.  
  13.                         for (int i = 0; i < mMouse.Length; ++i)
  14.                                 if (mMouse[i].dragged != null)
  15.                                         ++count;
  16.  
  17.                         if (mController.dragged != null)
  18.                                 ++count;
  19.  
  20.                         return count;
  21.                 }      
  22.         }

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UICamera.touchCount inconsistent between Editor and Mobile Device
« Reply #4 on: June 17, 2013, 09:45:24 PM »
Certainly.