OnTouch

Adapted from OnMouseDown by User:Caue.rego, this Javascript sends `OnMouse` equivalent messages based on touch devices taps.

Attach the script to the camera that is rendering the clickable (tappable) objects.

Add a layer argument to the Raycast call if you need to avoid unnecessary intersections.

This is only for objects with colliders, not for `GUIText` and `GUITexture`.

Instead of calling `OnMouse` events, we use `OnPointer` (suggested name) to emphasize how we should avoid `OnMouse` due to performance warnings. (Though I've got no idea if that's just a legacy warning).

OnTouch.js

Then, on whichever script you'd use OnMouse, use this instead: