public void Press (bool pressed)
{
...
if (pressed)
{
// Remove all momentum on press
mMomentum = Vector3.zero;
mScroll = 0f;
totalDistanceTravelled.x = totalDistanceTravelled.y = 0.0f; //Reset the distance dragged for sensitivity reason
// Disable the spring movement
DisableSpring();
...
public void Drag (Vector2 delta)
{
//We will only care if our sensitivity has cause our sensitivity to trigger
if(Mathf.Abs(scrollingDeadspace) > 0.01f) {
totalDistanceTravelled.x += Mathf.Abs(delta.x);
totalDistanceTravelled.y += Mathf.Abs(delta.y);
if(totalDistanceTravelled.magnitude < scrollingDeadspace) {
return; //Not travelled enough distance yet
}
}
....