public SxmlSerializer(string path) { using (var fs = new StreamReader(path)) { var serializer = new XmlSerializer(typeof(SxmlRoot), s_overrides); root = (SxmlRoot)serializer.Deserialize(fs); } }
///<summary> ///Use this for draw window. ///</summary> void OnGUI() { if (GUILayout.Button("Serialize")) { var path = EditorUtility.OpenFilePanel("Open", EditorApplication.applicationPath, "xml"); if (!string.IsNullOrEmpty(path)) { var ser = new SxmlSerializer(path); m_root = ser.root; } } }