public void SetType(ResourceType thisType) { PlayerKingdomData playerData = PlayerGameManager.GetInstance.playerData; currentTechs.Clear(); currentType = thisType; for (int i = 0; i < playerData.currentTechnologies.Count; i++) { if (playerData.currentTechnologies[i].improvedType == thisType) { BaseTechnology tmp = new BaseTechnology().ConverToData(playerData.currentTechnologies[i]); tmp.techIcon = TechnologyManager.GetInstance.techStorage.technologies.Find(x => x.technologyName == tmp.technologyName).techIcon; currentTechs.Add(tmp); } } for (int i = 0; i < currentTechs.Count; i++) { techOptions[i].techIcon.sprite = currentTechs[i].techIcon; techOptions[i].bgTechFill.fillAmount = (float)currentTechs[i].currentLevel / (float)currentTechs[i].goldLevelRequirements.Count; } }
public BaseTechnologyData ConverToData(BaseTechnology thisTech) { technologyName = thisTech.technologyName; improvedType = thisTech.improvedType; goldLevelRequirements = thisTech.goldLevelRequirements; currentLevel = thisTech.currentLevel; goldRequirement = thisTech.goldRequirement; curGold = thisTech.curGold; bonusIncrement = thisTech.bonusIncrement; troopTechType = thisTech.troopTechType; popTechType = thisTech.popTechType; foodTechType = thisTech.foodTechType; coinTechType = thisTech.coinTechType; effectMesg = thisTech.effectMesg; wittyMesg = thisTech.wittyMesg; return(this); }