- Home /
Question by
basavaraj_guled · May 07, 2016 at 05:38 AM ·
uitouchblock
prevent touching UI in android
please find the below code, in this code how can i prevent touching the UI
for (var i = 0; i < Input.touchCount; ++i) {
if (Input.GetTouch(i).phase == TouchPhase.Began)
{
if(!isTouched && Input.GetTouch(i).tapCount == 2)
{
if(tapCount == 2)
{
Debug.Log("Double tap..");
rb.AddForce(new Vector2(0f,force));
tapCount = 1;
}
}
}
if(isTouched && Input.GetTouch(i).phase == TouchPhase.Began)
{
Debug.Log("Single tap..");
rb.AddForce(new Vector2(0f,force));
}
}
Comment