示例#1
0
    public override void Going(float carSpeed)
    {
        Vector3 speed = carController.transform.forward * carSpeed * GameDatas.GetCarSpeedMultiplier();

        speed -= carController.transform.right * laneShiftingSpeed;

        carController.SetCarVelocity(speed);

        float goalLanePos = GetLanePosition();

        if (Mathf.Abs(carController.transform.position.x - goalLanePos) < laneTolerance)
        {
            carController.TransitionState(carController.straightState);
        }
    }
示例#2
0
 public override void Going(float carSpeed)
 {
     carController.SetCarVelocity(carController.transform.forward * carSpeed * GameDatas.GetCarSpeedMultiplier());
 }