If I understand you correctly you could store the last swipe movement and use it also for a stationary touch like e.g.
Vector2 currentDirection;
void Update()
{
if (Input.touchCount > 0)
{
touch = Input.GetTouch(0);
switch (touch.phase)
{
case TouchPhase.Moved:
currentDirection = touch.deltaPosition * speedModifier;
transform.position += currentDirection;
break;
case TouchPhase.Stationary:
transform.position += currentDirection;
break;
default:
currentDirection = Vector2.zero;
break;
}
}
}
This way it continuous to move with the last swipe velocity.
However, in general you should also take the Time.deltaTime
into account to be frame-rate independent.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…