Saves when a GameObject has been destroyed or disabled. More...
Classes | |
class | DestructibleData |
Public Types | |
enum | Mode { OnDisable , OnDestroy } |
enum | DestroyMode { Destroy , Deactivate } |
Public Member Functions | |
override void | OnBeforeSceneChange () |
The Save System will call this method before scene changes. | |
override void | OnDisable () |
override void | OnDestroy () |
virtual void | RecordDestruction () |
override string | RecordData () |
override void | ApplyData (string s) |
Public Member Functions inherited from PixelCrushers.Saver | |
virtual void | Awake () |
virtual void | Start () |
virtual void | Reset () |
virtual void | OnEnable () |
string | RecordData () |
This method should return a string that represents the data you want to save. | |
void | ApplyData (string s) |
This method should process the string representation of saved data and apply it to the current state of the game. | |
virtual void | ApplyDataImmediate () |
If the Saver needs to pull data from the Save System immediately after loading a scene, instead of waiting for ApplyData to be called at it its normal time, it can implement this method. | |
virtual void | OnRestartGame () |
The Save System will call this method when restarting the game. | |
Properties | |
Mode | mode [get, set] |
DestroyMode | destroyMode [get, set] |
GameObject | destroyedVersionPrefab [get, set] |
Properties inherited from PixelCrushers.Saver | |
bool | appendSaverTypeToKey [get, set] |
Append the name of this saver type to the key. | |
virtual string | key [get, set] |
Save data under this key. | |
string | _internalKeyValue [get, set] |
Accesses the internal key value. | |
virtual bool | saveAcrossSceneChanges [get, set] |
Save when changing scenes to be able to restore saved state when returning to scene. | |
virtual bool | restoreStateOnStart [get, set] |
Additional Inherited Members | |
Protected Attributes inherited from PixelCrushers.Saver | |
string | m_runtimeKey = null |
Saves when a GameObject has been destroyed or disabled.
The next time the game or scene is loaded, if the GameObject has previously been destroyed/disabled, this script will destroy/deactivate it again. It will also spawn a replacement destroyed version if a prefab is assigned.
|
inline |
|
inlinevirtual |
The Save System will call this method before scene changes.
If your saver listens for OnDisable or OnDestroy messages (see DestructibleSaver for example), it can use this method to ignore the next OnDisable or OnDestroy message since they will be called because the entire scene is being unloaded.
Reimplemented from PixelCrushers.Saver.
|
inlinevirtual |
Reimplemented from PixelCrushers.Saver.
|
inlinevirtual |
Reimplemented from PixelCrushers.Saver.
|
inline |
|
inlinevirtual |
|
getset |
|
getset |
|
getset |