コード例 #1
0
	public void initResearch(RnDRow aRow,GTCar aCar,UISprite aSprite) {
		this.gameObject.SetActive(true);
		researchRow = aRow; 
		carRef = aCar;
		GTEquippedResearch r = carRef.hasPart(aRow);
		if(r==null) {
			partNameTitle.text = aRow._partname+" (0/"+aRow._maxlevelstounlock+")"; 
		} else {
			partNameTitle.text = aRow._partname+" ("+r.activeLevel+"/"+aRow._maxlevelstounlock+")";
		}
		
		partDescription.text = aRow._partdescription;
	//	divisionRequired.text = "Division Required: "+aRow._partprerequisitedivision;
		if(aRow._partprerequisites.Length==0) {
			prerequisiteParts.text = "Prerequisite Parts: None";
		} else {
			prerequisiteParts.text = "Prerequisite Parts: "+aRow._partprerequisites;
		}
		lblCost.text = "Cost to Research: "+aRow._costtoresearch.ToString("C0");
		this.lblDaysToResearch.text = "Days to Research: "+aRow._daystoresearch;
		partGraphic.spriteName = aSprite.spriteName;
 		if(this.carRef.partBeingResearched!=null) {
			startResearchBtn.isEnabled = false;
		}
		
	}
コード例 #2
0
		public GTEquippedResearch(int aActiveLevel,int aDayOfCompletion,int aDaysOfResearchRemaining,int aRnDLevel,int aResearchID) {
			this.dayOfCompletion = aDayOfCompletion;
			this.daysOfResearchRemaining = aDaysOfResearchRemaining;
			this.level = aRnDLevel;
			for(int i = 0;i<RnD.Instance.Rows.Count;i++) {
				if(RnD.Instance.Rows[i]._id==aResearchID) {
					this.researchRow = RnD.Instance.Rows[i];
				}
			}
		}
コード例 #3
0
ファイル: GTCar.cs プロジェクト: cupsster/gtmanager
		public GTEquippedResearch addPartToCar(RnDRow aRow,GTTeam aTeam) {
		//	if(aRow._par
			for(int i = 0;i<rndParts.Count;i++) {
				if(this.hasPreRequisiteParts(aRow._partprerequisites)) {
					if(rndParts[i].researchRow==aRow) {
						if(rndParts[i].level<aRow._maxlevelstounlock) {
							rndParts[i].level++;
							return rndParts[i];
						} else {
							return null;
						}
					}
				}
			}
			if(this.hasPreRequisiteParts(aRow._partprerequisites)) {
				rndParts.Add(new GTEquippedResearch(aRow));
				return rndParts[rndParts.Count-1];
			} else {
				return null;
			}
		}
コード例 #4
0
ファイル: GTCar.cs プロジェクト: cupsster/gtmanager
		public GTEquippedResearch hasPart(RnDRow aRow)   {

			for(int j=0;j<rndParts.Count;j++) {
				if(rndParts[j].researchRow==aRow&&rndParts[j].level>0) {
					return rndParts[j];
				}
			}

			return null;
		}
コード例 #5
0
		public GTEquippedResearch (RnDRow aPart)
		{
			researchRow = aPart;
			level = 1;
		}
コード例 #6
0
ファイル: ResearchItem.cs プロジェクト: cupsster/gtmanager
	private void initResearchRow() {
		List<RnDRow> rows = RnD.Instance.Rows;
		for(int i = 0;i<rows.Count;i++) {
			if(rows[i]._id==researchItemID) {
				researchRow = rows[i];
			}
		}
	}