void Update() { Mercury = mercury.value * 100; Calcium = calcium.value * 100; Oil = oil.value * 100; m1.text = "Mercury \t\t" + Mercury.ToString(); m2.text = "Calcium\t\t" + Calcium.ToString(); m3.text = "Oil\t\t" + Oil.ToString(); }
public override void Update() { base.Update(); oilLabel.text = totals ? Oil.ToString() : Oil.ToString("P"); farmingLabel.text = totals ? Farming.ToString() : Farming.ToString("P"); oreLabel.text = totals ? Ore.ToString() : Ore.ToString("P"); forestLabel.text = totals ? Forest.ToString() : Forest.ToString("P"); districtNameLabel.text = Name.ToString(); sizeLabel.text = Size.ToString(); districtTypeLabel.spriteName = GetSpriteFromType(Type); districtNameLabel.textColor = new Color32(182, 221, 254, 255); farmingLabel.textColor = Farming == 0 ? new Color32(165, 165, 165, 128) : new Color32(182, 221, 254, 255); forestLabel.textColor = Forest == 0 ? new Color32(165, 165, 165, 128) : new Color32(182, 221, 254, 255); if (OreDecline) { oreLabel.textColor = new Color32(255, 182, 193, 128); } else { if (Ore == 0) { oreLabel.textColor = new Color32(165, 165, 165, 128); } else { oreLabel.textColor = new Color32(182, 221, 254, 255); } } if (OilDecline) { oilLabel.textColor = new Color32(255, 182, 193, 128); } else { if (Oil == 0) { oilLabel.textColor = new Color32(165, 165, 165, 128); } else { oilLabel.textColor = new Color32(182, 221, 254, 255); } } sizeLabel.textColor = new Color32(182, 221, 254, 255); }