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); }
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()); }
public virtual void AddToEditor(ParamsEditor editor) { SerializableEntityEditor = new SerializableEntityEditor(editor.EditorBox.Content.RectTransform, this, inGame: false, showName: true); SubParams.ForEach(sp => sp.AddToEditor(editor)); }
public void Reset() { Deserialize(OriginalElement, false); SubParams.ForEach(sp => sp.Reset()); }
public void SetCurrentElementAsOriginalElement() { OriginalElement = Element; SubParams.ForEach(sp => sp.SetCurrentElementAsOriginalElement()); }