public double Travel(double percent, float distance, Spline.Direction direction, out float moved, bool loop) { double max = direction == Spline.Direction.Forward ? 1.0 : 0.0; if (start >= 0) { max = spline.GetPointPercent(start); } return(TravelClamped(percent, distance, direction, max, out moved, loop)); }
private void SetupFollower(SplineComputer splineComputer) { _splineFollower = _player.GetComponent <SplineFollower>(); _splineFollower.spline = splineComputer; //To limit player's path to finish line ( last-1th point ) Last point setted for the path between Finish line and chest. var clipToPercent = splineComputer.GetPointPercent(splineComputer.GetPoints().Length - 2); _splineFollower.clipTo = clipToPercent; _splineFollower.onMotionApplied += OnPlayerMoved; }