public DriverOrderSetup getEngineOrderFromEnum(EDriverOrders aOrder) {
		for(int i = 0;i<engineOrders.Count;i++) {
			if(engineOrders[i].orderType==aOrder) {
				return engineOrders[i];
			}
		}
		return engineOrders[1];
	}
	public DriverOrderSetup getTyreOrderFromEnum(EDriverOrders aOrder) {
		for(int i = 0;i<tyreOrders.Count;i++) {
			if(tyreOrders[i].orderType==aOrder) {
				return tyreOrders[i];
			}
		}
		return tyreOrders[1];
	}
Beispiel #3
0
		public void Update() { 
			if(selectedCar!=null)
			if(selectedCar.currentOrders!=lastOrders) {
				lastOrders = selectedCar.currentOrders;
				if(this.btnDoOrDieEngine1==null) {
					initButtons();
					if(this.btnDoOrDieEngine1==null) {
						return;
					}
				}

			
			}
			if(selectedCar!=null)
			if(selectedCar.currentTyreOrders!=lastTyreOrders) {
				lastTyreOrders = selectedCar.currentTyreOrders;
				if(this.btnDoOrDieTyres1==null) {
					initButtons();
					if(this.btnDoOrDieTyres1==null) {
						return;
					}
				}
				
				this.btnDoOrDieTyres1.isEnabled = true;
				this.btnDriveNormalTyres1.isEnabled = true;
				this.btnTakeItEasyTyres1.isEnabled = true;
				switch(lastTyreOrders) {
					case(EDriverOrders.DoOrDie):this.btnDoOrDieTyres1.isEnabled = false;break;
					case(EDriverOrders.DriveNormal):this.btnDriveNormalTyres1.isEnabled = false;break;
					case(EDriverOrders.TakeItEasy):this.btnTakeItEasyTyres1.isEnabled = false;break;
				}
			}

		}
Beispiel #4
0
	public void changeEngineOrders(EDriverOrders aOrder) {
		if(aOrder!=this.currentOrders) {
			if(originalPower==0f||float.IsNaN(originalMaxRPM)) {
				originalPower = this.aiDriveTrain.GetMaxPower();
				originalTorque = this.aiDriveTrain.GetMaxTorque();
				this.originalMaxRPM = this.aiDriveTrain.revLimiterRPM;
			}
			if(this.humanControl&&aOrder==EDriverOrders.TakeItEasy&&DialogueLua.GetVariable("HintArrowOverheating").AsInt==1) {
				RaceManager.REF.doConversation("TutorialOverheating");
			}
			DriverOrderSetup newOrder = DriverOrderLibrary.REF.getEngineOrderFromEnum(aOrder);
			newOrder.addEffectToCar(this,this.wings);
		
			this.currentOrders = aOrder;
		}
	}
Beispiel #5
0
	public void changeTyreOrders(EDriverOrders aOrder) {
		if(aOrder!=this.currentTyreOrders) {
			if(originalPower==0f||float.IsNaN(originalMaxRPM)) {
				originalPower = this.aiDriveTrain.GetMaxPower();
				originalTorque = this.aiDriveTrain.GetMaxTorque();
				this.originalMaxRPM = this.aiDriveTrain.revLimiterRPM;
			}
			DriverOrderSetup newOrder = DriverOrderLibrary.REF.getTyreOrderFromEnum(aOrder);
			newOrder.addEffectToCar(this,this.wings);
			
			this.currentTyreOrders = aOrder;
		}
	}