コード例 #1
0
ファイル: CarAIControl.cs プロジェクト: nynnejc/snowmanland
        private void Awake()
        {
            // get the car controller reference
            carController = GetComponent<CarController>();

            // give the random perlin a random value
            randomPerlin = Random.value*100;
        }
コード例 #2
0
ファイル: CarAudio.cs プロジェクト: fafase/Catharsis
        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;
        }
コード例 #3
0
        private CarController car; // the car controller we want to use


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