示例#1
0
 public SxmlSerializer(string path)
 {
     using (var fs = new StreamReader(path))
     {
         var serializer = new XmlSerializer(typeof(SxmlRoot), s_overrides);
         root = (SxmlRoot)serializer.Deserialize(fs);
     }
 }
示例#2
0
 ///<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;
         }
     }
 }