Class JsonSaveableComponent
Namespace: GlitchedPolygons.SavegameFramework.Json
Assembly: UnityScriptsLibrary.dll
Syntax
public abstract class JsonSaveableComponent : SaveableComponent
Properties
| Improve this Doc View SourceID
The JsonSaveableComponent's ID. This is a unique identifier that should be immutable and persistent.
Declaration
public override int ID { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Overrides
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 override void AfterLoading()
Overrides
| Improve this Doc View SourceAwake()
Declaration
protected virtual void Awake()
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 override void BeforeSaving()
Overrides
| Improve this Doc View SourceOnDestroy()
Declaration
protected virtual void OnDestroy()
PrintID()
Declaration
protected void PrintID()
Operators
| Improve this Doc View SourceImplicit(JsonSaveableComponent to JsonSaveableComponentTuple)
Converts a JsonSaveableComponent instance to a JsonSaveableComponentTuple, ready to be serialized out into a JsonSavegame.
Declaration
public static implicit operator JsonSaveableComponentTuple(JsonSaveableComponent component)
Parameters
| Type | Name | Description |
|---|---|---|
| JsonSaveableComponent | component | JsonSaveableComponent to convert. |
Returns
| Type | Description |
|---|---|
| JsonSaveableComponentTuple |
|