private void Touches()
{
if (Input.touchCount == 1)
{
foreach (Touch touch in Input.touches)
{
switch (touch.phase)
{
case TouchPhase.Began:
if (_touchId == 0)
{
_touchId = touch.fingerId;
}
break;
case TouchPhase.Moved:
var delta = Mathf.Clamp(touch.deltaPosition.x, -_sensitivityLimiter, _sensitivityLimiter);
_velosity += _sensitivity * delta * transform.right;
break;
case TouchPhase.Canceled:
case TouchPhase.Ended:
transform.eulerAngles = new Vector3(0, 0, 0);
_touchId = 0;
break;
}
}
}
}