Show / Hide Table of Contents

Class XmlSaveableComponentExample

Example implementation of the XmlSaveableComponent (for the xml savegame framework).

Inheritance
System.Object
SaveableComponent
XmlSaveableComponent
XmlSaveableComponentExample
Inherited Members
XmlSaveableComponent.ID
XmlSaveableComponent.PrintID()
XmlSaveableComponent.Awake()
XmlSaveableComponent.OnDestroy()
Namespace: GlitchedPolygons.SavegameFramework.Xml.Examples
Assembly: UnityScriptsLibrary.dll
Syntax
public class XmlSaveableComponentExample : XmlSaveableComponent

Fields

| Improve this Doc View Source

testBool

Declaration
public bool testBool
Field Value
Type Description
System.Boolean
| Improve this Doc View Source

testFloat

Declaration
public float testFloat
Field Value
Type Description
System.Single
| Improve this Doc View Source

testInt

Declaration
public int testInt
Field Value
Type Description
System.Int32
| Improve this Doc View Source

testString

Declaration
public string testString
Field Value
Type Description
System.String

Methods

| Improve this Doc View Source

AfterLoading()

Declaration
public override void AfterLoading()
Overrides
XmlSaveableComponent.AfterLoading()
| Improve this Doc View Source

BeforeSaving()

Declaration
public override void BeforeSaving()
Overrides
XmlSaveableComponent.BeforeSaving()
| Improve this Doc View Source

GetXml()

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 System.Xml.Linq.XElement containing all data needed to reconstruct the object on LoadXml(XElement).

Overrides
XmlSaveableComponent.GetXml()
| Improve this Doc View Source

LoadXml(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 true if the loading procedure was successful; false if it failed in some way.

Overrides
XmlSaveableComponent.LoadXml(XElement)
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)!

  • Improve this Doc
  • View Source
Back to top Generated by DocFX