public void EnterRamp(Path path, Direction direction, Waypoint startWP, float rampEnterMomentumFactor, float rampGravityMultiplier, bool dropAtEnd, bool useGlobalRampExitSpeedMult, KickoutHole kickoutHole) { float speedEnteringRamp = Speed * rampEnterMomentumFactor; if (kickoutHole != null) { speedEnteringRamp = kickoutHole.KickForce; } else if (debug_useDebugRampSpeed) { speedEnteringRamp = debug_rampSpeed; } //Debug.Log("Ramp entered - speed: " + speedEnteringRamp); _ramp = path; //_dropAtEnd = dropAtEnd; _useGlobalRampExitSpeedMult = useGlobalRampExitSpeedMult; SetPhysicsEnabled(false); RampMotion.Activate(_ramp, direction, startWP, speedEnteringRamp, rampGravityMultiplier, dropAtEnd, kickoutHole); }
public void Activate(Path path, Direction direction, Waypoint startWaypoint, float speed, float rampGravityMultiplier, bool dropAtEnd, KickoutHole kickouthole) { if (speed > 0) { _onRamp = true; _getNextWaypoint = true; _directionChanged = false; _dropAtEnd = dropAtEnd; _kickOut = kickouthole != null; _path = path; _startDirection = direction; _direction = direction; _startWaypoint = startWaypoint; _prevWaypoint = startWaypoint; CurrentWaypoint = startWaypoint; _speed = speed; _rampGravityMultiplier = rampGravityMultiplier; _leftoverDistance = 0; _kickoutHole = kickouthole; //Debug.Log("Direction on path: " + direction); } }