private void ResetHospitals() { GameObject[] ExistingHospitals = GameObject.FindGameObjectsWithTag("Hospital"); foreach (GameObject hospital in ExistingHospitals) { HospitalController hospitalController = hospital.GetComponent <HospitalController>(); hospitalController.ClearSoldiersCollected(); } }