void Update() { if ((Input.touchCount > 0) && (Input.GetTouch(0).phase == TouchPhase.Began)) { Ray raycast = Camera.main.ScreenPointToRay(Input.GetTouch(0).position); RaycastHit raycastHit; if (Physics.Raycast(raycast, out raycastHit)) { CommunicatorBridge.message("You just hit the " + raycastHit.collider.name); } } }
void Start() { box = GameObject.Find("box"); CommunicatorBridge.message("Unity started"); }