Hi all,
I have jump function for Single touch, and Double touch(tap) for other function,
here the problem is when i double touch(tap) the single touch function also executing , here is my code.
void Update ()
{
for(int i = 0; i < Input.touchCount; i++)
{
if(Input.GetTouch(i).phase == TouchPhase.Began)
{
if(Input.GetTouch(i).tapCount == 2)
{
print("Double Touch");
StartCoroutine(SlowMotion());
}
else if(Input.GetTouch(i).tapCount == 1)
{
print("Single Touch");
if(isGameStart==true)
{
Jump();
_animator.enabled=true;
if (!this._animator.GetCurrentAnimatorStateInfo (0).IsName ("jumping1"))
{
_animator.SetBool("jumping",false);
}
else
{
_animator.SetBool("jumping",true);
}
}
}
}
}
}