void Update() { if (Input.GetMouseButton(0)) { if (_currentPath.points.Count == 0) { return; } Vector2 curFingerPos = Camera.main.ScreenToWorldPoint(Input.mousePosition); Vector2 lastPoint = _currentPath.points[_currentPath.points.Count - 1]; if (Vector2.Distance(curFingerPos, lastPoint) > newPointThreshold) { _currentPath.AddPoint(curFingerPos, Time.deltaTime); } else { _currentPath.StayStill(Time.deltaTime); } } }