foreach (Touch touch in Input.touches) { int id = touch.fingerId; if (EventSystem.current.IsPointerOverGameObject(id)) { // ui touched } }