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;
}
}
}
}
}