// Start is called before the first frame update void Start() { int children = transform.childCount; List <ForecastHandler.Forecast> usedForecast = new List <ForecastHandler.Forecast>(); usedForecast.Add(GameMaster.GM.displayUpgrades.forecast); for (int i = 0; i < children; ++i) { ForecastHandler.Forecast secondType = ForecastHandler.Forecast.Cold; foreach (ForecastHandler.Forecast forecast in System.Enum.GetValues(typeof(ForecastHandler.Forecast))) { if (!usedForecast.Contains(forecast)) { secondType = forecast; usedForecast.Add(forecast); break; } } DnaUpgrade upgrade = transform.GetChild(i).GetComponent <DnaUpgrade>(); upgrade.upgradeText(GameMaster.GM.displayUpgrades.forecast, secondType, i == 0); if (PlantationManager.plantations[GameMaster.GM.plantationManager.currentPlant].hasUpgrade(upgrade)) { upgrade.transform.GetChild(3).GetComponent <Button>().interactable = false; } } }
public bool Equals(DnaUpgrade d) { if ((object)d == null) { return(false); } return((type1 == d.type1) && (type2 == d.type2) && (positive == d.positive)); }
public override bool Equals(System.Object obj) { if (obj == null) { return(false); } DnaUpgrade d = obj as DnaUpgrade; if ((System.Object)d == null) { return(false); } return((type1 == d.type1) && (type2 == d.type2) && (positive == d.positive)); }