Class XmlSaveableComponentExample
Example implementation of the XmlSaveableComponent (for the xml savegame framework).
Inherited Members
Namespace: GlitchedPolygons.SavegameFramework.Xml.Examples
Assembly: UnityScriptsLibrary.dll
Syntax
public class XmlSaveableComponentExample : XmlSaveableComponent
Fields
| Improve this Doc View SourcetestBool
Declaration
public bool testBool
Field Value
| Type | Description |
|---|---|
| System.Boolean |
testFloat
Declaration
public float testFloat
Field Value
| Type | Description |
|---|---|
| System.Single |
testInt
Declaration
public int testInt
Field Value
| Type | Description |
|---|---|
| System.Int32 |
testString
Declaration
public string testString
Field Value
| Type | Description |
|---|---|
| System.String |
Methods
| Improve this Doc View SourceAfterLoading()
Declaration
public override void AfterLoading()
Overrides
| Improve this Doc View SourceBeforeSaving()
Declaration
public override void BeforeSaving()
Overrides
| Improve this Doc View SourceGetXml()
Gets the nicely formatted xml System.Xml.Linq.XElement containing all the data that is needed to reconstruct the saveable object through LoadXml(XElement).
Declaration
public override XElement GetXml()
Returns
| Type | Description |
|---|---|
| System.Xml.Linq.XElement | The |
Overrides
| Improve this Doc View SourceLoadXml(XElement)
Loads an System.Xml.Linq.XElement (hopefully the one that was originally produced by the GetXml() method) into the class.
This method should reconstruct the object's state on load, and then return
true if the procedure was successful (false if it failed in some way).
Declaration
public override bool LoadXml(XElement xElement)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Xml.Linq.XElement | xElement |
Returns
| Type | Description |
|---|---|
| System.Boolean | Should return |
Overrides
Remarks
This should NOT be used to make the SaveableComponent use the loaded data in any way: THIS IS JUST FOR LOADING DATA INTO THE CLASS FIELDS! Instead, use the AfterLoading() method for applying the loaded data (e.g. setting Transform positions and rotations and whatnot)!