- Home /
Question by
3lizzardy · Oct 16, 2015 at 10:40 PM ·
canvastouchphase
how to detect TouchPhase.Ended in UI?
void TouchAndHold()
{
for (var i = 0; i < Input.touchCount; ++i)
{
Touch touch = Input.GetTouch(i);
int pointerID = touch.fingerId;
if(EventSystem.current.IsPointerOverGameObject(pointerID))
{
// touch on ui
return;
}
if (touch.phase == TouchPhase.Began ) //Hold
{
// if active , rotate animation will start
ReadyToJumpWithRotateArrow();
}
else if (touch.phase == TouchPhase.Ended || touch.phase == TouchPhase.Canceled) //Release
{
MoveUsingRotateArrow ();
}
}
}
Hi sifu, i using code above for my game . I stuck at touchphase.ended . I try using bool but still not working. Any ideas how to solve this?
Comment
Your answer
