Class SaveableComponent
All components that you wish to be saved and loaded in some way between runtimes should inherit ultimately from this.
Find out more in the documentation of the implementing child classes, such as XmlSaveableComponent.
Namespace: GlitchedPolygons.SavegameFramework
Assembly: UnityScriptsLibrary.dll
Syntax
public abstract class SaveableComponent : MonoBehaviour
Properties
| Improve this Doc View SourceID
The SaveableComponent's ID. This is a unique identifier that should be immutable and persistent.
Declaration
public abstract int ID { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Methods
| Improve this Doc View SourceAfterLoading()
This is called after a successful Load(String).
Child classes should implement this and define what happens after the Load(String) fed the stored data into this class (e.g. if a SaveableComponent's
Transform.position is stored in the savegame, this would be the place to then take that value and load it back into the Transform).
Declaration
public abstract void AfterLoading()
BeforeSaving()
This is called by the SavegameManager implementation before saving this instance's data out to the savegame.
Use this to sync up any data if you need (e.g. loading Unity component data - which is NOT serialized alongside automatically; keep that in mind! - into some field on the savegame like for example a "Vector3 positionCoordinates;" or something like that, yea..)
Declaration
public abstract void BeforeSaving()