Ejemplo n.º 1
0
        public void Start()
        {
            CarEngine = GetComponent(typeof(RGKCar_Engine)) as RGKCar_Engine;
            CarSetup  = GetComponent(typeof(RGKCar_Setup)) as RGKCar_Setup;
            SetupAudioSources();



            for (int i = 0; i < this.RPMLevels.Count; i++)
            {
                this.RPMLevels[i].Source = ((i % 2) != 0) ? this.AudioChannel2 : this.AudioChannel1;
            }
            this.rpmLevelStages[0] = new RPMLevelStage();
            this.rpmLevelStages[1] = new RPMLevelStage();

            if (this.AudioChannel1 != null)
            {
                this.AudioChannel1.loop   = true;
                this.AudioChannel1.volume = 0f;
            }
            if (this.AudioChannel2 != null)
            {
                this.AudioChannel2.loop   = true;
                this.AudioChannel2.volume = 0f;
            }
        }
Ejemplo n.º 2
0
        // Initialize
        void Start()
        {
            GameObject GameManagerContainerGameObject = GameObject.Find("_RaceManager");

            RaceManager  = (Race_Manager)GameManagerContainerGameObject.GetComponent(typeof(Race_Manager));
            RaceRegister = (Racer_Register)transform.GetComponent(typeof(Racer_Register));

            CarSetup  = GetComponent(typeof(RGKCar_Setup)) as RGKCar_Setup;
            CarEngine = GetComponent(typeof(RGKCar_Engine)) as RGKCar_Engine;

            CarWheels = CarSetup.Wheels;

            if (centerOfMass != null)
            {
                rigidbody.centerOfMass = centerOfMass.localPosition;
            }
            rigidbody.inertiaTensor *= CarSetup.CarInteria;

            this.brakeLightsTextures    = CarSetup.LightsData.BrakelightsLightObjects;
            this.headLightTextures      = CarSetup.LightsData.HeadlightsLightObjects;
            this.headLightsLightObjects = CarSetup.LightsData.HeadlightsLights;
            this.brakeLightsLightObject = CarSetup.LightsData.BrakelightsLights;
            isHeadlightsOn = CarSetup.LightsData.LightsOn;

            waypointContainer = RaceManager.Waypoints;
            GetWaypoints();
        }
Ejemplo n.º 3
0
        void Start()
        {
            CarSetup  = GetComponent(typeof(RGKCar_Setup)) as RGKCar_Setup;
            CarEngine = GetComponent(typeof(RGKCar_Engine)) as RGKCar_Engine;

            engineSource = CreateAudioSource(Engine);
            skidSource   = CreateAudioSource(Skid);
        }
Ejemplo n.º 4
0
        // Initialize
        void Start()
        {
            CarSetup  = GetComponent(typeof(RGKCar_Setup)) as RGKCar_Setup;
            CarEngine = GetComponent(typeof(RGKCar_Engine)) as RGKCar_Engine;

            CarWheels = CarSetup.Wheels;

            if (centerOfMass != null)
            {
                rigidbody.centerOfMass = centerOfMass.localPosition;
            }

            rigidbody.inertiaTensor *= CarSetup.CarInteria;

            this.brakeLightsTextures    = CarSetup.LightsData.BrakelightsLightObjects;
            this.headLightTextures      = CarSetup.LightsData.HeadlightsLightObjects;
            this.headLightsLightObjects = CarSetup.LightsData.HeadlightsLights;
            this.brakeLightsLightObject = CarSetup.LightsData.BrakelightsLights;
            isHeadlightsOn = CarSetup.LightsData.LightsOn;
        }
Ejemplo n.º 5
0
        // Initialize
        void Start()
        {
            GameObject GameManagerContainerGameObject = GameObject.Find("_RaceManager");

            RaceManager  = (Race_Manager)GameManagerContainerGameObject.GetComponent(typeof(Race_Manager));
            RaceRegister = (Racer_Register)transform.GetComponent(typeof(Racer_Register));

            CarSetup  = GetComponent(typeof(RGKCar_Setup)) as RGKCar_Setup;
            CarEngine = GetComponent(typeof(RGKCar_Engine)) as RGKCar_Engine;
            CarWheels = CarSetup.Wheels;


            this.brakeLightsObjects        = CarSetup.LightsData.BrakelightsLightObjects;
            this.headLightObjects          = CarSetup.LightsData.HeadlightsLightObjects;
            this.headLightsLightComponent  = CarSetup.LightsData.HeadlightsLights;
            this.brakeLightsLightComponent = CarSetup.LightsData.BrakelightsLights;


            foreach (Transform brakeLightObject in brakeLightsObjects)
            {
                Material[] brakeMaterial = new Material[1]; brakeMaterial[0] = new Material(brakeLightObject.renderer.sharedMaterial);
                brakeLightObject.renderer.materials = brakeMaterial;
            }
            foreach (Transform headLightObject in headLightObjects)
            {
                Material[] headlightMaterial = new Material[1]; headlightMaterial[0] = new Material(headLightObject.renderer.sharedMaterial);
                headLightObject.renderer.materials = headlightMaterial;
            }



            if (centerOfMass != null)
            {
                rigidbody.centerOfMass = centerOfMass.localPosition;
            }

            rigidbody.inertiaTensor *= CarSetup.CarInteria;

            // RGK_Start();
        }