![]() |
Platformer Pro
2.3.2
A platform game kit for Unity.
|
Static class for managing persistable objects. More...
Public Member Functions | |
PersistableObjectData | GetState (string guid, bool defaultStateIsDisabled) |
Gets the state for the object with the given guid. This is not a copy! Creates new state if the guid is not found. More... | |
void | SetState (string guid, bool state, string extraInfo) |
Sets the state for the object with the given guid. More... | |
void | SetState (string guid, bool state, string extraInfo, string spawnObjectName, Vector3 spawnObjectPosition) |
void | Save () |
Updates persistable object state. More... | |
void | ResetAll () |
Reset persistable object state. More... | |
void | ResetCurrentlevel () |
Reset persistable object state. More... | |
virtual void | HandleGameOver (object sender, DamageInfoEventArgs e) |
Handles the game ending. More... | |
![]() | |
virtual void | Validate (PlatformerProMonoBehaviour myTarget) |
Override this method if you want to provide custom validation. The actual code should be surrounded by the if UNITY_EDITOR / endif directive. More... | |
Static Public Member Functions | |
static PersistableObjectManager | CreateNewPersistableObjectManager (bool saveOnChange, bool useBinaryFormat) |
Creates a new time manager. More... | |
Static Public Attributes | |
const string | UniqueDataIdentifier = "PersistableObjectManagerData" |
The player preference identifier. More... | |
Protected Member Functions | |
void | Init () |
Init this instance. More... | |
virtual void | SaveXml () |
Updates persistable object state using XML format. More... | |
virtual void | SaveBinary () |
Updates persistable object state using binary format. More... | |
void | Load () |
Load the saved data from prefs. More... | |
virtual void | LoadXml () |
Load the saved data from prefs in XMl format. More... | |
virtual void | LoadBinary () |
Load the saved data from prefs in XMl format. More... | |
virtual void | SpawnObjects (IEnumerable< PersistableObjectData > objectsToSpawn) |
Spawns loaded objects. More... | |
void | DoPendingSave (object sender, PersistenceEventArgs e) |
Trigger the saves in response to save event. More... | |
List< PersistableObjectData > | GetSaveData () |
Convert dictionary into savable list. More... | |
Protected Attributes | |
bool | useBinaryFormat |
If true save files in a binary format. False use XML. More... | |
bool | saveOnChange |
Should we save data on change. More... | |
Dictionary< string, PersistableObjectData > | objectData |
The persistence data. More... | |
bool | readyToSave |
Used to ensure that the will exit scene save happens at end of frame after all other objects have set their state. More... | |
Static Protected Attributes | |
static List< string > | allPrefsIdentifiers = new List<string> () |
Stores all pref kyes so we can reset data. More... | |
static BinaryFormatter | binaryFormatter |
A formatter used for binary serialisation. More... | |
Properties | |
bool | UseBinary [get] |
Should we use binary format? More... | |
BinaryFormatter | BinaryFormatter [get] |
Get a binary formatter for use in saving. More... | |
virtual string | PlayerPrefsIdentifier [get] |
The player preference identifier. More... | |
![]() | |
virtual string | Header [get] |
Gets the header string used to describe the component. More... | |
virtual string | DocLink [get] |
Gets a link to documentation site. More... | |
virtual string | VideoLink [get] |
Gets a link to a youtube video. More... | |
virtual string | Deprecated [get] |
If non-null this component is deprecated. The string shows a message indicating how it should be replaced. More... | |
Static class for managing persistable objects.
|
static |
Creates a new time manager.
|
protected |
Trigger the saves in response to save event.
|
protected |
Convert dictionary into savable list.
PersistableObjectData PlatformerPro.PersistableObjectManager.GetState | ( | string | guid, |
bool | defaultStateIsDisabled | ||
) |
Gets the state for the object with the given guid. This is not a copy! Creates new state if the guid is not found.
guid | GUID. |
defaultStateIsDisabled | If true the object starts disabled. |
|
virtual |
Handles the game ending.
sender | Sender. |
e | Event data. |
|
protected |
Init this instance.
|
protected |
Load the saved data from prefs.
|
protectedvirtual |
Load the saved data from prefs in XMl format.
|
protectedvirtual |
Load the saved data from prefs in XMl format.
void PlatformerPro.PersistableObjectManager.ResetAll | ( | ) |
Reset persistable object state.
void PlatformerPro.PersistableObjectManager.ResetCurrentlevel | ( | ) |
Reset persistable object state.
void PlatformerPro.PersistableObjectManager.Save | ( | ) |
Updates persistable object state.
|
protectedvirtual |
Updates persistable object state using binary format.
|
protectedvirtual |
Updates persistable object state using XML format.
void PlatformerPro.PersistableObjectManager.SetState | ( | string | guid, |
bool | state, | ||
string | extraInfo | ||
) |
Sets the state for the object with the given guid.
guid | GUID. |
state | State to set. |
extraInfo | Extra info. |
void PlatformerPro.PersistableObjectManager.SetState | ( | string | guid, |
bool | state, | ||
string | extraInfo, | ||
string | spawnObjectName, | ||
Vector3 | spawnObjectPosition | ||
) |
|
protectedvirtual |
Spawns loaded objects.
|
staticprotected |
Stores all pref kyes so we can reset data.
|
staticprotected |
A formatter used for binary serialisation.
|
protected |
The persistence data.
|
protected |
Used to ensure that the will exit scene save happens at end of frame after all other objects have set their state.
|
protected |
Should we save data on change.
|
static |
The player preference identifier.
|
protected |
If true save files in a binary format. False use XML.
|
get |
Get a binary formatter for use in saving.
|
get |
The player preference identifier.
|
get |
Should we use binary format?