Need Clarification on some Touch Struct Variables

After going through all available documentation and quite extensive searches on the internet I’m still not quite clear on how the following are implemented in Unity:

  1. Touch.fingerId: Apparently, an integer is automatically assigned to this variable when a touch occurs. Through Internet searches I found that the first number assigned is 0, and that subsequent touches get assigned numbers in increments of 1, so if 5 fingers touch the screen one-after-another, the fingerId’s assigned will be 0,1,2,3,4. My questions are:
    a. What if the first finger (fingerId=0), is raised and then immediately touches again, and then raised and retouched one more time. Would it lose the fingerId=0 assignment, and get a 5 and then 6 assignment on the subsequent 2 touches?
    b. What if fingers corresponding to -say- fingerId=2 and 4 were raised, and after some time they retouched the screen, while the other 3 fingers were still touching and with fingerId’s=0,1,3. Would the 2 ‘new’ fingers get assigned fingerId’s=5, 6, or would they fill the gaps with fingerId’s=2,4? In the former case, is there a limit to the sequence of touches, and hence the range of the fingerId’s, or is this just limited by the int type?
    c. Do the fingerId’s persist for a ‘touch sequence’, i.e. until there are no more screen touches, and then the auto-numbering starts from 0 again?
  2. Touch.tapCount: This records number of taps for a specific Touch, and hence for a specific fingerId. However, if a finger is raised TouchPhase.Ended is fired, signifying the end of a Touch, and thus the end of the specific fingerId. So, how can this happen? How can tapCount, report a count of -say- 3 taps for a specific fingerId, if this fingerId gets cancelled once the finger gets raised (after the initial tap) and TouchPhase.Ended is fired?

I thank you in advance for your attention and help.

iOS/Droid is allocating the FingerIds - you should consider them to be opaque because it is doing clever stuff to work out if this is the same finger - this is also the answer to your second question. tapCount can only be greater than 1 if the OS has figured out that this is the same finger.

You use a fingerID to track the movement of a single finger, you should not expect specific values even if they appear to be consistent on some platform, it’s certainly possible that the fingerID for real finger would change between calls, despite the best efforts of the OS to make it persistent - so the only thing you might get is the tapCount being > 1 because the OS is reporting that.