Esempio n. 1
0
		public void initFromDatabase(string aUsersTeamName) {
			List<DriverLibraryRecord> availableDrivers = DriverLibrary.REF.drivers;
			for(int i = 0;i<availableDrivers.Count;i++) {
				availableDrivers[i].assignedTeam = 0;
			}
			GTDriver.allDrivers = new List<GTDriver>();
			List<DriverLibraryRecord> availableDrivers1 = DriverLibrary.REF.getAllAvailableDrivers();
			for(int i = 0;i<availableDrivers1.Count;i++) {
				GTDriver g = new GTDriver();
				g.initFromLibrary(availableDrivers1[i]);
			}
			ACTIVE_SEASON = this;
			List<TeamDataRecord> allTeams = Database.TeamDatabase.REF.teams;
			for(int i = 0;i<allTeams.Count;i++) {
				this.seasonForLeague(allTeams[i].startLeague).addTeam(new GTTeam(allTeams[i]));
			}
			for(int i = 0;i<this.leagues.Count;i++) {
				for(int c = 0;c<leagues[i].teams.Count;c++) {
					leagues[i].teams[c].ignoreFromRelegationAndPromotion = false;
				}
			}
			this.season = 1;
			this.getUsersTeam().teamName = aUsersTeamName;
			DialogueLua.SetVariable("PlayersTeamName",aUsersTeamName);
			ChampionshipSeason.ACTIVE_SEASON = this;
			if(Application.loadedLevelName=="MainMenu") {
				StartCoroutine(this.LoadLevel("Garage","Loading Garage"));
			}
		}
Esempio n. 2
0
		public TeamDataRecord (TeamNamesRow aTeamNameRow)
		{
			id = aTeamNameRow._id;
			name = aTeamNameRow._teamname;
			description = aTeamNameRow._teamdescription;
			teamColor = new Color(aTeamNameRow._teamcolorr/255f,aTeamNameRow._teamcolorg/255f,aTeamNameRow._teamcolorb/255f);
			wheelColor = new Color(aTeamNameRow._wheelcolorr/255f,aTeamNameRow._wheelcolorg/255f,aTeamNameRow._wheelcolorb/255f);
			startLeague = aTeamNameRow._startleague;
			
			carA = new GTCar (aTeamNameRow._startingcar1);
			reputation = aTeamNameRow._reputation;
			
  
			driverA = new GTDriver (); 
			DriverLibraryRecord driverRecord = DriverLibrary.REF.getAvailableDriver();
			driverRecord.assignedTeam = id;
			driverA.initFromLibrary(driverRecord);
			carB = new GTCar (aTeamNameRow._startingcar2);
  
			driverB = new GTDriver ();
			driverRecord = DriverLibrary.REF.getAvailableDriver();
			driverB.initFromLibrary(driverRecord);
			driverRecord.assignedTeam = id;

		}
Esempio n. 3
0
	// Use this for initialization
	void Start () {
		UM_InAppPurchaseManager.instance.Init();
		DontDestroyOnLoad (this.gameObject);
		this.GetComponent<DriverLibrary> ().init ();
		this.GetComponent<CarDatabase> ().init ();
		this.GetComponent<TeamDatabase> ().init ();
		List<DriverLibraryRecord> availableDrivers = DriverLibrary.REF.getAllAvailableDrivers();
		for(int i = 0;i<availableDrivers.Count;i++) {
			GTDriver g = new GTDriver();
			g.initFromLibrary(availableDrivers[i]);
		}
		this.GetComponent<TrackDatabase>().init();
		this.GetComponent<SponsorDatabase>().init();
		if(Application.loadedLevelName=="InitGame") {
			Application.LoadLevel("MainMenu");
		}
		
		UM_InAppPurchaseManager.instance.addEventListener(UM_InAppPurchaseManager.ON_BILLING_CONNECT_FINISHED, OnConnectFinished);
	//	ChampionshipSeason champ = GameObject.Find ("ChampionshipObject").GetComponent<ChampionshipSeason>();
	//	champ.initFromDatabase();
		//StartCoroutine(LoadLevel());

	}