コード例 #1
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();
    }
コード例 #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();
    }
コード例 #3
0
    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>());
    }
コード例 #4
0
    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>());
    }