Feel  3.16
The best way to improve your game's feel and make it extra juicy
MoreMountains.Tools.MMPersistent Class Reference

A persistent class that can save the essential parts of an object : its transform data (position, rotation, scale) and its active state This inherits from MMPersistentBase and implements the IMMPersistent interface It's a good example of how to implement the interface's OnSave and OnLoad methods More...

Inheritance diagram for MoreMountains.Tools.MMPersistent:
MoreMountains.Tools.MMPersistentBase MoreMountains.Tools.IMMPersistent

Classes

struct  ComponentData
 
struct  Data
 A struct used to store and serialize the data we want to save More...
 

Public Member Functions

override string OnSave ()
 On Save, we turn the object's transform data and active state to a Json string and return it to the MMPersistencyManager More...
 
override void OnLoad (string data)
 On load, we read the saved json data and apply it to our object's properties More...
 
- Public Member Functions inherited from MoreMountains.Tools.MMPersistentBase
virtual string GetGuid ()
 Returns the object's GUID More...
 
virtual void SetGuid (string newGUID)
 Lets you set the object's GUID More...
 
virtual bool ShouldBeSaved ()
 Lets the persistence manager know whether or not the object should be saved More...
 
virtual string GenerateGuid ()
 Generates a unique ID for the object, using the scene name, the object name, and a GUID More...
 
virtual bool GuidIsUnique (string guid)
 Checks if the object's ID is unique or not More...
 
virtual void ValidateGuid ()
 Validates the object's GUID, and generates a new one if needed, until a unique one is found More...
 

Public Attributes

bool SavePosition = true
 whether or not to save this object's position More...
 
bool SaveLocalRotation = true
 whether or not to save this object's rotation More...
 
bool SaveLocalScale = true
 whether or not to save this object's scale More...
 
bool SaveActiveState = true
 whether or not to save this object's active state More...
 
bool SaveEnabledStates = false
 whether or not to save this object's components' enabled states More...
 
- Public Attributes inherited from MoreMountains.Tools.MMPersistentBase
bool SaveActive = true
 whether or not this object should be saved More...
 
string UniqueIDSuffix
 an optional suffix to add to the GUID, to make it more readable More...
 
bool GenerateGuidButton
 a debug button used to force a new GUI generation More...
 

Protected Member Functions

virtual List< ComponentDataGetCurrentComponents ()
 Grabs all components on this object More...
 
- Protected Member Functions inherited from MoreMountains.Tools.MMPersistentBase
virtual void OnValidate ()
 On validate, we make sure the object gets a valid GUID More...
 

Additional Inherited Members

- Protected Attributes inherited from MoreMountains.Tools.MMPersistentBase
string _guid
 the object's unique ID More...
 

Detailed Description

A persistent class that can save the essential parts of an object : its transform data (position, rotation, scale) and its active state This inherits from MMPersistentBase and implements the IMMPersistent interface It's a good example of how to implement the interface's OnSave and OnLoad methods

Member Function Documentation

◆ GetCurrentComponents()

virtual List<ComponentData> MoreMountains.Tools.MMPersistent.GetCurrentComponents ( )
protectedvirtual

Grabs all components on this object

◆ OnLoad()

override void MoreMountains.Tools.MMPersistent.OnLoad ( string  data)
virtual

On load, we read the saved json data and apply it to our object's properties

Parameters
data

Reimplemented from MoreMountains.Tools.MMPersistentBase.

◆ OnSave()

override string MoreMountains.Tools.MMPersistent.OnSave ( )
virtual

On Save, we turn the object's transform data and active state to a Json string and return it to the MMPersistencyManager

Returns

Reimplemented from MoreMountains.Tools.MMPersistentBase.

Member Data Documentation

◆ SaveActiveState

bool MoreMountains.Tools.MMPersistent.SaveActiveState = true

whether or not to save this object's active state

◆ SaveEnabledStates

bool MoreMountains.Tools.MMPersistent.SaveEnabledStates = false

whether or not to save this object's components' enabled states

◆ SaveLocalRotation

bool MoreMountains.Tools.MMPersistent.SaveLocalRotation = true

whether or not to save this object's rotation

◆ SaveLocalScale

bool MoreMountains.Tools.MMPersistent.SaveLocalScale = true

whether or not to save this object's scale

◆ SavePosition

bool MoreMountains.Tools.MMPersistent.SavePosition = true

whether or not to save this object's position


The documentation for this class was generated from the following file: