Search Unity

maximum number of TouchIDs?

Discussion in 'UGUI & TextMesh Pro' started by craig4android, Oct 28, 2019.

  1. craig4android

    craig4android

    Joined:
    May 8, 2019
    Posts:
    124
    I want to track gestures.
    So I intend to use TouchIDs to keep track of different IDs.
    I plan to use an Array like so:

    Code (CSharp):
    1. Touch[] touches=new Touch[30];
    2.  
    3. //setting those touches
    4. touches[newtouch.fingerId]=newtouch;
    5.  
    6. //later access old touches by
    7. Touch oldtouch= touches[fingerId];
    however this might fail once the touchid is bigger than 30.

    to keep performance high I would prefer not to check if fingerId is bigger than 30. However I'm not sure if this is an good idea since theoretically fingerId could be bigger than 30. But how likely is this going to happen?