public static GalaxyManager DeserializeGalaxyManager(XmlReader reader) { GalaxyManager galman = GalaxyManager.instance; while (reader.Read()) { if (reader.IsStartElement()) { switch (reader.LocalName) { case "GALAXY_DATA": GalaxyManager.ReadXml(reader, galman); break; case "Sector": Sector sector = DeserializeSector(reader); Debug.Log(sector.index); galman.SetSector(sector, sector.index); break; } } } return(galman); }