function Update () {
//Rileva il tocco
if((Input.touchCount>0) && (Input.GetTouch(0).phase == TouchPhase.Ended))
{
mappa[5,5].GetComponent.<Click>().toccato=1;
// for (var k=0; k<size; k++) {
//
// for (var n=0; n<size; n++) {
//
// if (mappa[k,n]==GetClickedItem(Input.GetTouch(0).position)) {
// var appActive : int;
// appActive=mappa[k,n].GetComponent.<Click>().activate;
// if (appActive==1) {
// mappa[k,n].GetComponent.<Click>().toccato=1;
// }
// }
//
// }
// }
}
cameraSet();
}
function GetClickedItem(pos: Vector2)
{
var camera : Camera = Camera.main;
var p : Vector3 = camera.ScreenToWorldPoint(Vector3 (pos[0], pos[1], camera.nearClipPlane));
var hit : RaycastHit;
if(Physics.Raycast(p, Vector3(0.0,0.0,1.0), hit))
return hit.collider.gameObject;
else
return null;
}
I would like to know why not detect the touch.
It 's all right, but the screen does not feel the touch. I tried using a device with Android and Android emulator
Help me please