private void WriteShipViewer(BinaryWriter Writer) { foreach (GameObject g in Children) { if (g.GetType().Equals(typeof(ShipViewer))) { ShipViewer s = (ShipViewer)g; Writer.Write(s.model.getFullPath()); Writer.Write(s.effect.getFullPath()); ColorParameter DrawColor = (ColorParameter)s.effect.findValueParameter("DrawColor"); ColorParameter SpecularColor = (ColorParameter)s.effect.findValueParameter("SpecularColor"); FloatParameter SpecularExponent = (FloatParameter)s.effect.findValueParameter("SpecularExponent"); Texture2DParameter Texture = (Texture2DParameter)s.effect.findValueParameter("Texture"); Writer.Write(Texture.getFullPath()); SaveHelper.Write(DrawColor.get()); SaveHelper.Write(SpecularColor.get()); Writer.Write((Single)SpecularExponent.get()); return; } } throw new Exception("No ShipViewer to save"); }