private CarMotor m_Car; // the car motor we want to use

    private void Awake()
    {
        m_Rigidbody = GetComponent<Rigidbody>();
        m_Car = new CarMotor();
        m_Car.SetCarMovementInterface(this);
        m_Car.InitializeCarMotor(m_CentreOfMassOffset, m_MaximumSteerAngle, m_SteerHelper, m_TractionControl, m_FullTorqueOverAllWheels, m_ReverseTorque, m_Topspeed, m_RevRangeBoundary, m_SlipLimit, m_BrakeTorque);
        m_Car.SetCarAudioInterface(this);
        m_Car.InitializeCarAudio(lowPitchMin, lowPitchMax);
        m_Car.StartSound();
    }
Beispiel #2
0
    private CarMotor m_Car; // the car motor we want to use

    private void Awake()
    {
        m_Rigidbody = GetComponent <Rigidbody>();
        m_Car       = new CarMotor();
        m_Car.SetCarMovementInterface(this);
        m_Car.InitializeCarMotor(m_CentreOfMassOffset, m_MaximumSteerAngle, m_SteerHelper, m_TractionControl, m_FullTorqueOverAllWheels, m_ReverseTorque, m_Topspeed, m_RevRangeBoundary, m_SlipLimit, m_BrakeTorque);
        m_Car.SetCarAudioInterface(this);
        m_Car.InitializeCarAudio(lowPitchMin, lowPitchMax);
        m_Car.StartSound();
    }
    public void CarAudio()
    {
        // Arrange
        CarMotor car   = new CarMotor();
        var      audio = GetAudioMock();

        car.SetCarAudioInterface(audio);
        car.InitializeCarAudio(0.5f, 0.5f);

        //Act
        car.CarAudio();

        //Assert
        audio.Received().AdjustPitch(Arg.Any <float>());
        audio.Received().AdjustVolumes(Arg.Any <float>(), Arg.Any <float>(), Arg.Any <float>(), Arg.Any <float>());
    }
    public void CarAudio()
    {
        // Arrange
        CarMotor car = new CarMotor();
        var audio = GetAudioMock();
        car.SetCarAudioInterface(audio);
        car.InitializeCarAudio(0.5f, 0.5f);

        //Act
        car.CarAudio();

        //Assert
        audio.Received().AdjustPitch(Arg.Any<float>());
        audio.Received().AdjustVolumes(Arg.Any<float>(), Arg.Any<float>(), Arg.Any<float>(), Arg.Any<float>());
    }