Show / Hide Table of Contents

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.

Inheritance
System.Object
SaveableComponent
JsonSaveableComponent
XmlSaveableComponent
Namespace: GlitchedPolygons.SavegameFramework
Assembly: UnityScriptsLibrary.dll
Syntax
public abstract class SaveableComponent : MonoBehaviour

Properties

| Improve this Doc View Source

ID

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 Source

AfterLoading()

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()
| Improve this Doc View Source

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()

See Also

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