Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: yuewah on June 13, 2013, 09:48:09 PM

Title: UICamera.touchCount inconsistent between Editor and Mobile Device
Post by: yuewah on June 13, 2013, 09:48:09 PM
1. Press UIButton, UICamera.touchCount = 1 ( Editor ), 1 (Device )
2. Press In Empty Area, UICamera.touchCount = 0 ( Editor ), 1 ( Device )
Title: Re: UICamera.touchCount inconsistent between Editor and Mobile Device
Post by: yuewah 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.  
Title: Re: UICamera.touchCount inconsistent between Editor and Mobile Device
Post by: ArenMook on June 14, 2013, 05:15:26 PM
Fair enough, I will add this in, thanks.
Title: Re: UICamera.touchCount inconsistent between Editor and Mobile Device
Post by: yuewah 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.         }
Title: Re: UICamera.touchCount inconsistent between Editor and Mobile Device
Post by: ArenMook on June 17, 2013, 09:45:24 PM
Certainly.