// Use this for initialization void Start () { placeCars = GameObject.FindObjectOfType(typeof (IRDSPlaceCars)) as IRDSPlaceCars; }
// public CarLibrary carLib; // Use this for initialization void Start () { lastUpdate = Time.time; REF = this; Time.timeScale = 1f; carCamera = GameObject.Find("Main_Camera").GetComponent<IRDSCarCamera>(); levLoad = GameObject.Find ("LevelLoad").GetComponent<IRDSLevelLoadVariables>(); levLoad.laps = 3; //Screen.SetResolution(640, 480, true); carCamera.ActivateRoadCamera (); if (TeamDatabase.REF == null) { return; } GameObject light = GameObject.Find("Directional Light"); Light dl = light.GetComponent<Light>(); switch(SettingsScreen.shadowLevel) { case(0):dl.shadows = LightShadows.None;break; case(1):dl.shadows = LightShadows.Hard;break; case(2):dl.shadows = LightShadows.Soft;break; } NGUIDisabler.PAUSED_TIME_SCALE = 0.1f; // Time.timeScale = 4; manager = GameObject.Find ("IRDSManager").GetComponent<IRDSManager> (); statistics =manager.GetComponentInChildren<IRDSStatistics>(); statistics.startRaceManually = true; // statistics.StartTheRace(); carCamera = manager.GetComponentInChildren<IRDSCarCamera>(); placeCars = manager.gameObject.GetComponentInChildren<IRDSPlaceCars> (); // BetterList<IRDSCarControllerAI> allCars = new BetterList<IRDSCarControllerAI> (); genericRaceGUI = GameObject.Find("GenericRaceGUI"); UILabel totalLaps = GameObject.Find("LAP").GetComponent<UILabel>(); driver1Label = GameObject.Find("DriverMessage1").GetComponent<UILabel>(); driver2Label = GameObject.Find("DriverMessage2").GetComponent<UILabel>(); simSpeedBtn = GameObject.Find("SimSpeedButton").GetComponent<UIButton>(); simSpeedLbl = GameObject.Find("SimSpeedButton").GetComponent<UILabel>(); simSpeedBtn.onClick.Add(new EventDelegate(this,"onSimSpeedChange")); if(genericRaceGUI!=null) { genericRaceGUI.gameObject.SetActive(false); } List<GTDriver> driversInRace = ChampionshipRaceSettings.ACTIVE_RACE.driversForRace(); totalLaps.text = "/ "+this.levLoad.laps; GameObject raceStarters = GameObject.Find("RaceLineupPanel"); if(raceStarters!=null) { raceStartersTable = raceStarters.GetComponent<RaceStarterTable>(); raceStartersTable.activate(driversInRace); } for(int i = 0;i<this.fv.Count;i++) { fv[i].enabled = true; } if(levLoad.raceStartType!=IRDSLevelLoadVariables.RaceStartType.Rolling) { StartCoroutine(makeCars()); } else { raceStartersTable.allowRaceStart(); } // }