void StationsEditor() { StationController toBeRemoved = null; for (int i = 0; i < creator.editingLineStations.Count; i++) { if (GUILayout.Button(creator.editingLineStations[i].GetIdAndName())) { toBeRemoved = creator.editingLineStations[i]; } if (creator.travelTimes.Count > 0 && i < creator.travelTimes.Count) { creator.travelTimes[i] = EditorGUILayout.FloatField("travel time [sec]:", creator.travelTimes[i]); } } if (toBeRemoved != null) { creator.RemoveStationFromNewLine(toBeRemoved); toBeRemoved = null; } }