Example #1
0
        private void Awake()
        {
            // get the car controller reference
            carController = GetComponent<CarController>();

            // give the random perlin a random value
            randomPerlin = Random.value*100;
        }
Example #2
0
        private CarController carController; // Reference to car we are controlling

        private void StartSound()
        {

            // get the carcontroller ( this will not be null as we have require component)
            carController = GetComponent<CarController>();

            // setup the simple audio source
            highAccel = SetUpEngineAudioSource(highAccelClip);

            // if we have four channel audio setup the four audio sources
            if (engineSoundStyle == EngineAudioOptions.FourChannel)
            {
                lowAccel = SetUpEngineAudioSource(lowAccelClip);
                lowDecel = SetUpEngineAudioSource(lowDecelClip);
                highDecel = SetUpEngineAudioSource(highDecelClip);
            }

            // setup the skid sound source
            skidSource = SetUpEngineAudioSource(skidClip);

            // flag that we have started the sounds playing
            startedSound = true;
        }
Example #3
0
        private CarController car; // the car controller we want to use


        private void Awake()
        {
            // get the car controller
            car = GetComponent<CarController>();
        }
Example #4
0
 private void Awake()
 {
     // get the car controller
     car = GetComponent <CarController>();
 }