private List <Vehiculo> obtenerListaVehiculos() { List <Vehiculo> vehiculos = new List <Vehiculo>(); List <GameObject> listaCarros = salaEsperaController.getListCars(); foreach (GameObject car in listaCarros) { vehicle classCar = car.GetComponent <vehicle>(); int id = classCar.getID(); int time = (int)System.Math.Round(classCar.getTime()); char type = classCar.getType(); Vehiculo vehiculo = new Vehiculo(id, type, time); vehiculos.Add(vehiculo); } return(vehiculos); }