private void SerializeBrushCollection() { string brushXmlPath = System.IO.Path.Combine(Application.dataPath, "BrushCollectionTest.xml"); BrushCollection brushes = new BrushCollection(); brushes.Brushes.Add(lineSketchObject.GetBrush()); brushes.Brushes.Add(patchSketchObject.GetBrush()); brushes.Brushes.Add(ribbonSketchObject.GetBrush()); Serializer.SerializeToXmlFile <BrushCollection>(brushes, brushXmlPath); BrushCollection loadedBrushes; Serializer.DeserializeFromXmlFile <BrushCollection>(out loadedBrushes, brushXmlPath); Debug.Log(loadedBrushes.Brushes.Count); }