- Home /
Question by
TOROPOT · Mar 17, 2010 at 12:28 PM ·
iphoneiphonetouchiphoneinput
The iPhoneInput.touchCount is 5 while more or no touch actually.
This is a period of codes to test the touch read of iPhoneInput.
I've found if I put 6 fingers or over (ex: 10), the iPhoneInput.touchCount will be always 5, and the phases are "Stationary" even when there is no longer any finger touch on it.
Why? Is that a bug of Unity-iPhone 1.6?
IEnumerator Thread_ReadTouch( TPCode t ) { while ( bGameStill ) { yield return null;
if ( iPhoneInput.touchCount > 0 )
{
iPhoneTouch[] Touches = iPhoneInput.touches;
Debug.Log( iPhoneInput.touchCount + ", "+ Touches.Length );
for ( int i = 0; i < iPhoneInput.touchCount; i++ )
{
switch ( Touches[ i ].phase )
{
case iPhoneTouchPhase.Began:
Debug.Log( "# Touch " + i + ", fid " + Touches[i].fingerId + ", Began" );
break;
case iPhoneTouchPhase.Moved:
Debug.Log( "# Touch " + i + ", fid " + Touches[ i ].fingerId + ", Moved" );
break;
case iPhoneTouchPhase.Stationary:
Debug.Log( "# Touch " + i + ", fid " + Touches[ i ].fingerId + ", Stationary" );
break;
case iPhoneTouchPhase.Canceled:
Debug.Log( "# Touch " + i + ", fid " + Touches[ i ].fingerId + ", Canceled" );
break;
case iPhoneTouchPhase.Ended:
Debug.Log( "# Touch " + i + ", fid " + Touches[ i ].fingerId + ", Ended" );
break;
}
}
}
}
}
Comment
Answer by adam 1.du · Nov 15, 2010 at 10:55 AM
http://unity3d.com/support/documentation/Manual/Input.html
"The iPhone and iPod Touch devices are capable of tracking up to five fingers touching the screen simultaneously"