private void Awake() { // get the car controller reference carController = GetComponent<CarController>(); // give the random perlin a random value randomPerlin = Random.value*100; }
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; }
private CarController car; // the car controller we want to use private void Awake() { // get the car controller car = GetComponent<CarController>(); }
private void Awake() { // get the car controller car = GetComponent <CarController>(); }