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

A point at which the character can respawn. Transform should exactly match where the character will spawn. More...

Inheritance diagram for PlatformerPro.RespawnPoint:
PlatformerPro.PersistableObject PlatformerPro.PlatformerProMonoBehaviour

Public Member Functions

virtual void SetActive (Character c)
 Set this respawn point as the active one. More...
 
virtual void SetEnabled ()
 Enable this respawn point. More...
 
- Public Member Functions inherited from PlatformerPro.PersistableObject
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 isDefaultStartingPoint
 Is this point the default starting point which is activated on scene load. More...
 
string identifier
 Unique name for this respawn point. More...
 
bool dontActivateOnRespawn
 If true the respawn point wont be activated when you spawn here. Generally used for doors so you can respawn at a position but if you die you wont go back there. More...
 
float autoProximityTriggerRange
 If true create a proximity trigger which activates the respawn point automatically. More...
 
Sprite autoSwitchSprite
 If non-null the Respawn Point will try to find an image component and update its sprite. If you want to do more use an EventResponder to listen to the Activated Event or create a custom trigger. More...
 
int facingDirection
 Set the facing direction on spawn as either LEFT (-1), RIGHT (1) or NO_CHANGE (use whatever direction was last faced). More...
 
jnamobile.mmm.PointOfInterest poi
 Reference to point of interest on a map. You can use this to override door POI settings. More...
 
bool useDefaultPersistence = true
 Does this Item get persistence defaults form the Game manager? More...
 
- Public Attributes inherited from PlatformerPro.PersistableObject
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

void OnActivated (Character c)
 Raises the activated event. More...
 
virtual void Init ()
 Init this instance. More...
 
override void PostInit ()
 PostInit this instance. Called from Start. More...
 
virtual void CreateProximityTrigger (float range)
 Creates a basic proximity trigger for enabling respawn point. More...
 
override void SetPersistenceDefaults ()
 Sets the persistence defaults. More...
 
override void ApplyCustomPersistence (PersistableObjectData data)
 Custom persistable implementation. Override to customise. More...
 
- Protected Member Functions inherited from PlatformerPro.PersistableObject
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...
 

Protected Attributes

SpriteRenderer spriteRenderer
 Cached sprite reference used if auto switch sprite is true. More...
 

Properties

override string Header [get]
 Gets the header string used to describe the component. More...
 
bool IsActive [get]
 Returns true if this Respawn Point is active. More...
 
bool IsEnabled [get]
 Returns true if this Respawn Point is enabled. More...
 
- Properties inherited from PlatformerPro.PersistableObject
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...
 

Events

System.EventHandler< CharacterEventArgsActivated
 Event trigger when this spawn point is activated. More...
 

Detailed Description

A point at which the character can respawn. Transform should exactly match where the character will spawn.

Member Function Documentation

◆ ApplyCustomPersistence()

override void PlatformerPro.RespawnPoint.ApplyCustomPersistence ( PersistableObjectData  data)
protectedvirtual

Custom persistable implementation. Override to customise.

Parameters
dataData.

Reimplemented from PlatformerPro.PersistableObject.

◆ CreateProximityTrigger()

virtual void PlatformerPro.RespawnPoint.CreateProximityTrigger ( float  range)
protectedvirtual

Creates a basic proximity trigger for enabling respawn point.

Parameters
rangeRange.

◆ Init()

virtual void PlatformerPro.RespawnPoint.Init ( )
protectedvirtual

Init this instance.

◆ OnActivated()

void PlatformerPro.RespawnPoint.OnActivated ( Character  c)
protected

Raises the activated event.

Parameters
cCharacter ref.

◆ PostInit()

override void PlatformerPro.RespawnPoint.PostInit ( )
protectedvirtual

PostInit this instance. Called from Start.

Reimplemented from PlatformerPro.PersistableObject.

◆ SetActive()

virtual void PlatformerPro.RespawnPoint.SetActive ( Character  c)
virtual

Set this respawn point as the active one.

◆ SetEnabled()

virtual void PlatformerPro.RespawnPoint.SetEnabled ( )
virtual

Enable this respawn point.

◆ SetPersistenceDefaults()

override void PlatformerPro.RespawnPoint.SetPersistenceDefaults ( )
protectedvirtual

Sets the persistence defaults.

Reimplemented from PlatformerPro.PersistableObject.

Member Data Documentation

◆ autoProximityTriggerRange

float PlatformerPro.RespawnPoint.autoProximityTriggerRange

If true create a proximity trigger which activates the respawn point automatically.

◆ autoSwitchSprite

Sprite PlatformerPro.RespawnPoint.autoSwitchSprite

If non-null the Respawn Point will try to find an image component and update its sprite. If you want to do more use an EventResponder to listen to the Activated Event or create a custom trigger.

◆ dontActivateOnRespawn

bool PlatformerPro.RespawnPoint.dontActivateOnRespawn

If true the respawn point wont be activated when you spawn here. Generally used for doors so you can respawn at a position but if you die you wont go back there.

◆ facingDirection

int PlatformerPro.RespawnPoint.facingDirection

Set the facing direction on spawn as either LEFT (-1), RIGHT (1) or NO_CHANGE (use whatever direction was last faced).

◆ identifier

string PlatformerPro.RespawnPoint.identifier

Unique name for this respawn point.

◆ isDefaultStartingPoint

bool PlatformerPro.RespawnPoint.isDefaultStartingPoint

Is this point the default starting point which is activated on scene load.

◆ poi

jnamobile.mmm.PointOfInterest PlatformerPro.RespawnPoint.poi

Reference to point of interest on a map. You can use this to override door POI settings.

◆ spriteRenderer

SpriteRenderer PlatformerPro.RespawnPoint.spriteRenderer
protected

Cached sprite reference used if auto switch sprite is true.

◆ useDefaultPersistence

bool PlatformerPro.RespawnPoint.useDefaultPersistence = true

Does this Item get persistence defaults form the Game manager?

Property Documentation

◆ Header

override string PlatformerPro.RespawnPoint.Header
get

Gets the header string used to describe the component.

The header.

◆ IsActive

bool PlatformerPro.RespawnPoint.IsActive
get

Returns true if this Respawn Point is active.

◆ IsEnabled

bool PlatformerPro.RespawnPoint.IsEnabled
get

Returns true if this Respawn Point is enabled.

Event Documentation

◆ Activated

System.EventHandler<CharacterEventArgs> PlatformerPro.RespawnPoint.Activated

Event trigger when this spawn point is activated.


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