Example #1
0
	// Use this for initialization
	void Start () {
		if(researchBoxTitle==null) {
			researchBoxTitle = GameObject.Find("ResearchBoxTitle").GetComponent<UILabel>();
		}
		ResearchItem[] kids = this.GetComponentsInChildren<ResearchItem>();
		for(int i = 0;i<kids.Length;i++) {
			researchItems.Add(kids[i]);
		}
		camController = GameObject.Find("Main Camera").GetComponent<GarageCameraController>();

		StartCoroutine(delayToInit());

	}
Example #2
0
	public void initFromCar(GTCar aCar) {
		camController = GameObject.Find("Main Camera").GetComponent<GarageCameraController>();
		carRef = aCar;
		GTTeam team = ChampionshipSeason.ACTIVE_SEASON.getUsersTeam();
		this.researchBoxTitle.text = aCar.carLibRecord.name+" - "+team.getDriverFromCar(carRef).name;

		if(team.cars[0]==aCar) {
			camController.lookAtThis = GameObject.Find ("GarageLeftSide");
		} else {
			camController.lookAtThis = GameObject.Find ("GarageRightSide");
		}
		if(carRef.partBeingResearched!=null) {
			this.currentlyResearching.text = "Currently Researching: "+carRef.partBeingResearched.researchRow._partname+" ("+carRef.partBeingResearched.daysOfResearchRemaining+" Day(s) Remaining)";
		}	else {
			this.currentlyResearching.text = "Currently Researching: [ff0000]Nothing![-]";
		}
		StartCoroutine(delayToInit());
	}
Example #3
0
	public void onSelectOtherDriver() {
		if(otherDrivers!=null) {
			Destroy(otherDrivers.gameObject);
		}
		
		GTTeam team = ChampionshipSeason.ACTIVE_SEASON.getUsersTeam();
		camController = GameObject.Find("Main Camera").GetComponent<GarageCameraController>();
		
		if(team.drivers[0]==this.driverRef) {
			this.initDriver(team.drivers[1]);
			camController.lookAtThis = GameObject.Find ("GarageRightSide");
			
			
		} else if(team.drivers[1]==this.driverRef) {
			this.initDriver(team.drivers[0]);
			camController.lookAtThis = GameObject.Find ("GarageLeftSide");
		}

		
	}
Example #4
0
	public void initDriver(GTDriver aDriver) {
		//if(driverTitle==null)
		initLabels();
		camController = GameObject.Find("Main Camera").GetComponent<GarageCameraController>();
		
		if(driverTitle!=null) {
			driverTitle.text = aDriver.name;
			brakingAggressionBar.value = GTDriver.percentOfGoodnessBrakingValue(aDriver.aggressivenessOnBrake);
			this.corneringBar.value = GTDriver.percentOfGoodnessCorneringValue(aDriver.corneringSpeedFactor);
			float errorVal = GTDriver.percentOfGoodnessErrorValue(aDriver.humanError);
			this.errorProneBar.value = errorVal;
			this.overtakingBar.value = GTDriver.percentOfGoodnessOvertakingValue(aDriver.overtakeSpeedDifference);
			this.sponsorAppealBar.value = GTDriver.percentOfGoodnessSponsorValue(aDriver.sponsorFriendliness);
		/*	brakingAggressionLabel.text = aDriver.brakingAggressionString;
			corneringLabel.text = aDriver.corneringSkillString;
			errorProneLabel.text = aDriver.errorProneString;
			overtakingLabel.text = aDriver.overtakingString;
		//	staminaLabel.text = aDriver.staminaString;*/
			GTTeam team = aDriver.contract.team;
			if(team==null) {
				this.currentTeamLabel.text = "No Team";
				
			} else
				this.currentTeamLabel.text = team.teamName;
			
			faceSprite.sprite2D = aDriver.record.sprite;;
			//this.sponsorAppealLabel.text = aDriver.sponsorAppealString;
			
			this.payPerRaceLabel.text = ""+aDriver.contract.payPerRace.ToString("C0");

			
		}
		if(overtakingBar.sprites.Count==0) {
			StartCoroutine(waitToReinit(aDriver));
		}
		this.driverRef = aDriver;
	}
Example #5
0
	public void initCar(GTCar aCar) {
		if(carTitle==null) {  
			initLabels();
		} 
		
		GTTeam team = ChampionshipSeason.ACTIVE_SEASON.getUsersTeam();
		camController = GameObject.Find("Main Camera").GetComponent<GarageCameraController>();
		carRef = aCar;
		this.showCar(aCar);
		
		this.showCarImprovements();

		if(team.cars[0]==carRef) {
			camController.lookAtThis = GameObject.Find ("GarageLeftSide");
			
		} else {
			camController.lookAtThis = GameObject.Find ("GarageRightSide");
		}


	}
Example #6
0
	public void gotoOtherCar() {
		GTTeam team = ChampionshipSeason.ACTIVE_SEASON.getUsersTeam();
		camController = GameObject.Find("Main Camera").GetComponent<GarageCameraController>();
		
		if(team.cars[0]==carRef) {
			this.initCar(team.cars[1]);
			
		} else {
			this.initCar(team.cars[0]);
		}

	}