コード例 #1
0
ファイル: Wagon.cs プロジェクト: saint-angels/ToadRunner
            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));
            }
コード例 #2
0
    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;
    }