function Update () { var clickDetected : boolean; var touchPosition : Vector3; if (Application.platform == RuntimePlatform.IPhonePlayer) isTouchDevice = true; else isTouchDevice = false; // Detect click and calculate touch position if (isTouchDevice) { clickDetected = (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began); touchPosition = Input.GetTouch(0).position; } else { clickDetected = (Input.GetMouseButtonDown(0)); touchPosition = Input.mousePosition; }