Platformer Pro  2.3.2
A platform game kit for Unity.
PlatformerPro.PersistableObject Class Reference

Component to attach to an object if you wish its state to be saved. More...

Inheritance diagram for PlatformerPro.PersistableObject:
PlatformerPro.PlatformerProMonoBehaviour PlatformerPro.Enemy PlatformerPro.Item PlatformerPro.Platform PlatformerPro.RespawnPoint PlatformerPro.Trigger PlatformerPro.RotatingEnemy PlatformerPro.SequenceDrivenEnemy PlatformerPro.ConveyerPlatform PlatformerPro.CrumblingPlatform PlatformerPro.DepthPlatform PlatformerPro.DepthSwitchPlatform PlatformerPro.DestroyOnHeadbutt PlatformerPro.DestructiblePlatform PlatformerPro.Door PlatformerPro.FallingPlatform PlatformerPro.HorizontalSpringboardPlatform PlatformerPro.IgnoreColliderPlatform PlatformerPro.ParentOnStandPlatform PlatformerPro.PlatformLogger PlatformerPro.SpawnOnHeadbutt PlatformerPro.SpecialMovementPlatform PlatformerPro.SpringboardPlatform PlatformerPro.Stairs PlatformerPro.StompOnHead PlatformerPro.TrapdoorPlatform PlatformerPro.TriggerPlatform PlatformerPro.ConditionTrigger PlatformerPro.OneWayTrigger PlatformerPro.ProximityTrigger PlatformerPro.TimerTrigger PlatformerPro.TriggerCombiner PlatformerPro.TriggerPlatformTrigger PlatformerPro.UnityTrigger

Public Member Functions

void SetPersistenceState (bool state)
 Sets the persistence state. More...
 
void SetPersistenceState (bool state, string extraPersistenceData)
 Sets the persistence state, overriding extra persistence data More...
 
- Public Member Functions inherited from PlatformerPro.PlatformerProMonoBehaviour
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...
 

Public Attributes

bool enablePersistence
 Should we enable persistence? More...
 
string guid = System.Guid.NewGuid().ToString()
 Unique ID for this object. You shoulnd't need to edit this, use editor debug mode if you must. More...
 
GameObject target
 GameObject to apply persitence settings to, defaults to self. More...
 
PersistableObjectType persistenceImplementation
 How do we implement the persistence settings. More...
 
bool defaultStateIsDisabled
 If true then the obejct starts disabled. More...
 
string spawnedObjectName
 If this item was spawned then save the name of the prefab here. More...
 

Protected Member Functions

virtual void PostInit ()
 Init this instance. More...
 
virtual void SetPersistenceDefaults ()
 Sets the persistence defaults. More...
 
virtual void ProcessState ()
 Processes the persisted state. More...
 
virtual void ApplyExtraPersistenceData (PersistableObjectData data)
 Apply any extra data. This differs from custom persistence, as custom persistence must control both data and ctivation state. More...
 
virtual void ApplyCustomPersistence (PersistableObjectData data)
 Custom persistable implementation. Override to customise. More...
 

Properties

virtual string ExtraPersistenceData [get]
 Gets the extra persistence data. More...
 
- Properties inherited from PlatformerPro.PlatformerProMonoBehaviour
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...
 

Detailed Description

Component to attach to an object if you wish its state to be saved.

Member Function Documentation

◆ ApplyCustomPersistence()

virtual void PlatformerPro.PersistableObject.ApplyCustomPersistence ( PersistableObjectData  data)
protectedvirtual

Custom persistable implementation. Override to customise.

Parameters
dataData.

Reimplemented in PlatformerPro.Trigger, PlatformerPro.SpawnOnHeadbutt, PlatformerPro.Platform, PlatformerPro.Door, PlatformerPro.RespawnPoint, and PlatformerPro.Enemy.

◆ ApplyExtraPersistenceData()

virtual void PlatformerPro.PersistableObject.ApplyExtraPersistenceData ( PersistableObjectData  data)
protectedvirtual

Apply any extra data. This differs from custom persistence, as custom persistence must control both data and ctivation state.

Parameters
dataData.

Reimplemented in PlatformerPro.Item.

◆ PostInit()

◆ ProcessState()

virtual void PlatformerPro.PersistableObject.ProcessState ( )
protectedvirtual

Processes the persisted state.

◆ SetPersistenceDefaults()

virtual void PlatformerPro.PersistableObject.SetPersistenceDefaults ( )
protectedvirtual

Sets the persistence defaults.

Reimplemented in PlatformerPro.Door, PlatformerPro.Item, PlatformerPro.RespawnPoint, and PlatformerPro.Enemy.

◆ SetPersistenceState() [1/2]

void PlatformerPro.PersistableObject.SetPersistenceState ( bool  state)

Sets the persistence state.

Parameters
stateState to set.

◆ SetPersistenceState() [2/2]

void PlatformerPro.PersistableObject.SetPersistenceState ( bool  state,
string  extraPersistenceData 
)

Sets the persistence state, overriding extra persistence data

Parameters
stateState to set.

Member Data Documentation

◆ defaultStateIsDisabled

bool PlatformerPro.PersistableObject.defaultStateIsDisabled

If true then the obejct starts disabled.

◆ enablePersistence

bool PlatformerPro.PersistableObject.enablePersistence

Should we enable persistence?

◆ guid

string PlatformerPro.PersistableObject.guid = System.Guid.NewGuid().ToString()

Unique ID for this object. You shoulnd't need to edit this, use editor debug mode if you must.

◆ persistenceImplementation

PersistableObjectType PlatformerPro.PersistableObject.persistenceImplementation

How do we implement the persistence settings.

◆ spawnedObjectName

string PlatformerPro.PersistableObject.spawnedObjectName

If this item was spawned then save the name of the prefab here.

◆ target

GameObject PlatformerPro.PersistableObject.target

GameObject to apply persitence settings to, defaults to self.

Property Documentation

◆ ExtraPersistenceData

virtual string PlatformerPro.PersistableObject.ExtraPersistenceData
getprotected

Gets the extra persistence data.

The extra persistence data.


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