private void SetDemands(District district) { foreach (UISlider slider in m_demandSprite.GetComponentsInChildren <UISlider> ()) { if (slider.name.Equals("ResidentialDemand")) { slider.value = CalculateResidentialDemand(district); } else if (slider.name.Equals("CommercialDemand")) { slider.value = CalculateCommercialDemand(district); } else if (slider.name.Equals("IndustryOfficeDemand")) { slider.value = CalculateWorkplaceDemand(district); } } }