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

A trigger which checks a condition and enters when condition is met, then exits when condition is not met. More...

Inheritance diagram for PlatformerPro.ConditionTrigger:
PlatformerPro.Trigger PlatformerPro.PersistableObject PlatformerPro.PlatformerProMonoBehaviour

Public Attributes

int playerId = -1
 The player identifier. More...
 
bool resetOnCharacterLoad
 If a new character gets loaded in the same player id should state stay as it is or be reset to false. More...
 
- Public Attributes inherited from PlatformerPro.Trigger
TriggerTarget[] receivers
 The Targets that receive the triggers actions. More...
 
bool actAsSwitch
 If true this trigger will have an on/off state and the trigger actions will only be sent if they match the on/off state. More...
 
bool startSwitchAsOn
 If true the switch starts in the on state. More...
 
bool sendSwitchEventsOnLoad = true
 
bool oneShot
 Fire this trigger once only then disable? More...
 
float autoLeaveTime
 Time after enter in which leave will be automatically triggered. Ignored if 0 or smaller. More...
 
MonoBehaviour requiredComponent
 If this is not null (none) then the required MonoBehaviour must be active and enabled before trigger will activate. More...
 
bool useDefaultPersistence
 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

override void PostInit ()
 Init this instance. More...
 
virtual void CheckCharacter (KeyValuePair< int, Character > kvp)
 Checks the character (with associated id) is triggering conditions. More...
 
override bool EnterTrigger (Character character)
 Enters the trigger. More...
 
override bool LeaveTrigger (Character character)
 Character leaves the trigger. More...
 
- Protected Member Functions inherited from PlatformerPro.Trigger
virtual void OnTriggerEntered (Character character, bool onOffState)
 Raises the trigger entered event. More...
 
virtual void OnTriggerExited (Character character)
 Raises the trigger exited event. More...
 
override void PostInit ()
 Initialise the sensor. More...
 
virtual void DoEnterTrigger (Character character)
 Do the trigger work More...
 
virtual void SavePersistenceData ()
 Gets the extra persistence data which is used to save platform state. NOTE: Generally you should override ExtraPersistenceData to save a different set of data. More...
 
override void ApplyCustomPersistence (PersistableObjectData data)
 Custom persistable implementation. Override to customise. More...
 
virtual bool ConditionsMet (Character character)
 Are the conditions for firing this trigger met? More...
 
virtual bool ExitConditionsMet (Character character)
 Are the conditions for exiting trigger met. More...
 
virtual IEnumerator DoLeaveAfterDelay (Character character, float delay)
 Does the autoleave action. Cancelled by the leave being triggerd. More...
 
virtual void DoLeaveTrigger (Character character)
 Does the actual work for leavinga trigger. More...
 
- Protected Member Functions inherited from PlatformerPro.PersistableObject
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...
 

Protected Attributes

Dictionary< int, Charactercharacters
 Map of characters to player ids. More...
 
Dictionary< int, bool > stateMap
 Map of states to player id. More...
 
- Protected Attributes inherited from PlatformerPro.Trigger
IEnumerator autoLeaveRoutine
 Stores the autoleave routine. More...
 
AdditionalCondition[] conditions
 Cached list of all additional conditions. More...
 
bool onOffState
 Are we on or off? true = on. More...
 

Properties

override string Header [get]
 Gets the header. More...
 
- Properties inherited from PlatformerPro.Trigger
bool SwitchState [get]
 
- 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...
 

Additional Inherited Members

- 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...
 
- Static Public Attributes inherited from PlatformerPro.Trigger
static Color GizmoColor = new Color (1, 0.64f, 0, 0.5f)
 Default color to use when draing Trigger gizmos. More...
 
- Static Protected Attributes inherited from PlatformerPro.Trigger
static bool isLoaded
 Have we reloaded characters. More...
 
- Events inherited from PlatformerPro.Trigger
System.EventHandler< CharacterEventArgsTriggerEntered
 Event for trigger enter. More...
 
System.EventHandler< CharacterEventArgsTriggerExited
 Event for trigger leave. More...
 

Detailed Description

A trigger which checks a condition and enters when condition is met, then exits when condition is not met.

Member Function Documentation

◆ CheckCharacter()

virtual void PlatformerPro.ConditionTrigger.CheckCharacter ( KeyValuePair< int, Character kvp)
protectedvirtual

Checks the character (with associated id) is triggering conditions.

Parameters
kvpKvp.

◆ EnterTrigger()

override bool PlatformerPro.ConditionTrigger.EnterTrigger ( Character  character)
protectedvirtual

Enters the trigger.

Returns
true, if trigger was entered, false otherwise.
Parameters
characterCharacter.

Reimplemented from PlatformerPro.Trigger.

◆ LeaveTrigger()

override bool PlatformerPro.ConditionTrigger.LeaveTrigger ( Character  character)
protectedvirtual

Character leaves the trigger.

Parameters
characterCharacter. NOTE: This can be null if triggered by something that is not a character.

Reimplemented from PlatformerPro.Trigger.

◆ PostInit()

override void PlatformerPro.ConditionTrigger.PostInit ( )
protectedvirtual

Init this instance.

Reimplemented from PlatformerPro.PersistableObject.

Member Data Documentation

◆ characters

Dictionary<int, Character> PlatformerPro.ConditionTrigger.characters
protected

Map of characters to player ids.

◆ playerId

int PlatformerPro.ConditionTrigger.playerId = -1

The player identifier.

◆ resetOnCharacterLoad

bool PlatformerPro.ConditionTrigger.resetOnCharacterLoad

If a new character gets loaded in the same player id should state stay as it is or be reset to false.

◆ stateMap

Dictionary<int, bool> PlatformerPro.ConditionTrigger.stateMap
protected

Map of states to player id.

Property Documentation

◆ Header

override string PlatformerPro.ConditionTrigger.Header
get

Gets the header.


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