public virtual bool Serialize(bool recursive = true)
 {
     SerializableProperty.SerializeProperties(this, Element, true);
     if (recursive)
     {
         SubParams.ForEach(sp => sp.Serialize(true));
     }
     return(true);
 }
 public virtual bool Deserialize(bool recursive = true)
 {
     SerializableProperties = SerializableProperty.DeserializeProperties(this, Element);
     if (recursive)
     {
         SubParams.ForEach(sp => sp.Deserialize(true));
     }
     return(SerializableProperties != null);
 }
예제 #3
0
 public virtual bool Serialize(XElement element = null, bool recursive = true)
 {
     element = element ?? Element;
     SerializableProperty.SerializeProperties(this, element, true);
     if (recursive)
     {
         SubParams.ForEach(sp => sp.Serialize());
     }
     return(true);
 }
 public virtual void AddToEditor(ParamsEditor editor, bool recursive = true, int space = 0, ScalableFont titleFont = null)
 {
     SerializableEntityEditor = new SerializableEntityEditor(editor.EditorBox.Content.RectTransform, this, inGame: false, showName: true, titleFont: titleFont ?? GUI.LargeFont);
     if (recursive)
     {
         SubParams.ForEach(sp => sp.AddToEditor(editor, true, titleFont: titleFont ?? GUI.SmallFont));
     }
     if (space > 0)
     {
         new GUIFrame(new RectTransform(new Point(editor.EditorBox.Rect.Width, space), editor.EditorBox.Content.RectTransform), style: null, color: new Color(20, 20, 20, 255))
         {
             CanBeFocused = false
         };
     }
 }
 public virtual void Reset()
 {
     // Don't use recursion, because the reset method might be overriden
     Deserialize(false);
     SubParams.ForEach(sp => sp.Reset());
 }
예제 #6
0
 public virtual void AddToEditor(ParamsEditor editor)
 {
     SerializableEntityEditor = new SerializableEntityEditor(editor.EditorBox.Content.RectTransform, this, inGame: false, showName: true);
     SubParams.ForEach(sp => sp.AddToEditor(editor));
 }
예제 #7
0
 public void Reset()
 {
     Deserialize(OriginalElement, false);
     SubParams.ForEach(sp => sp.Reset());
 }
예제 #8
0
 public void SetCurrentElementAsOriginalElement()
 {
     OriginalElement = Element;
     SubParams.ForEach(sp => sp.SetCurrentElementAsOriginalElement());
 }