Unity handles multi-touch by giving you the number of touches on the screen during a given frame, and/or gives you an array of all touches during a frame. There are two ways of accessing touches, a good way, and a not as good way.
//The good way;
var tapCount = Input.touchCount;
for ( var i = 0 ; i < tapCount ; i++ ) {
var touch = Input.GetTouch(i);
//Do whatever you want with the current touch.
}
This way is good because it doesn’t allocate any new memory on the heap. tapCount and touch are both structures, that means they are stack allocated. If you don’t know what that means, stack allocated is usually a good thing. If you need to access multiple touches at one time for something like a pinch-spread motion, you can do that just fine too.
var tapCount = Input.touchCount;
if(tapCount > 1) {
var touch1 = Input.GetTouch(0);
var touch2 = Input.GetTouch(1);
}
Then there’s the not-as-good way of doing it. It isn’t necessarily bad, but it does allocate memory on the stack which isn’t good.
var touches = Input.touches;
for ( var touch in touches) {
//Do stuff with this touch
}
that will let you do pretty much the same stuff, its just not as efficient.