Beispiel #1
0
        private void Awake()
        {
            // get the car controller reference
            m_CarController = GetComponent <MyCarController>();

            // give the random perlin a random value
            m_RandomPerlin = Random.value * 100;

            m_Rigidbody = GetComponent <Rigidbody>();
        }
Beispiel #2
0
        // Reference to car we are controlling


        private void StartSound()
        {
            // get the carcontroller ( this will not be null as we have require component)
            m_CarController = GetComponent <MyCarController>();

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

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

            // flag that we have started the sounds playing
            m_StartedSound = true;
        }
Beispiel #3
0
 /// <summary>
 /// Awake this instance.
 /// </summary>
 void Awake()
 {
     // get the car controller
     m_Car = GetComponent <MyCarController>();
 }