// Use this for initialization void Start () { lastUpdate = Time.time; GameObject stats = GameObject.Find ("IRDSManager"); statistics = stats.GetComponentInChildren<IRDSStatistics> (); if (statistics == null) { statistics = stats.GetComponent<IRDSStatistics>(); } }
// 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(); } // }
// Use this for initialization void Start () { mainManager = GameObject.FindObjectOfType (typeof(IRDSManager)) as IRDSManager; mainManager.Ff = lapCountWidth; statistics = GameObject.FindObjectOfType(typeof(IRDSStatistics)) as IRDSStatistics; }
void Update(){ if (!IRDSStatistics.GetCanRace())enableGUI = false; if (!enableGUI && IRDSStatistics.GetCurrentCar() != null && IRDSStatistics.GetCurrentCar().GetEndRace()) { if (stats == null)stats = GameObject.FindObjectOfType(typeof(IRDSStatistics)) as IRDSStatistics; if (stats !=null) allDrivers = stats.GetAllDriversList(); driversCount = allDrivers.Count; //The current car have ended the race, show the statistics of this race and all the other stuff. enableGUI = true; //Process all drivers earned points for this race //ProcessDriversPoints(); StartCoroutine(CallProcessDrivers()); } }
void Start(){ stats = GameObject.FindObjectOfType(typeof(IRDSStatistics)) as IRDSStatistics; AddPlayerToChampionshipDrivers(); endResultsOptions = new GUIContent[2]; endResultsOptions[0] = new GUIContent("Drivers results"); endResultsOptions[1] = new GUIContent("Teams results"); }