I currently use Input.touchCount
and Input.GetMouseButtonDown
. Is there a function which will work for touch and mouse click, so I’d have to use just one function? Also, how to retrieve the clicked position (x, y)?
Research Input.touches to get touch information like position. Nothing in Unity allows you to abstract away from writing separate code for touch and screen beyond the support for both in OnMouse*() callback functions. Third-party scripts like FingerGestures allow you to write to a single interface, but they are not free.