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

A trigger that only fires when you walk through in a certain direction (with a minimum speed). More...

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

Public Attributes

float height
 The height. Note that height is evaluated against the position of the characters transform (it doesn't take character height in to account). More...
 
float velocity
 The required velocity (speed and direction). Use 'speed < 0' for right to left, and 'speed > 0' for left to right. 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 ()
 Initialise the sensor. More...
 
virtual void CheckMoveThrough ()
 Checks the move through. 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 bool EnterTrigger (Character character)
 Character entered proximity. 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 bool LeaveTrigger (Character character)
 Character leaves the trigger. 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

List< CharactercharactersOnTriggeringSide
 Characters to left. More...
 
bool isUpAndDownTrigger
 If we are rotated by 90 degrees the trigger is up to down or down to up, instead of left to right/right to left. 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...
 

Static Protected Attributes

const float Proximity = 0.5f
 How close before we start tracking the cahracter. Larger numbers support higher speeds, but have more performance cost. More...
 
- Static Protected Attributes inherited from PlatformerPro.Trigger
static bool isLoaded
 Have we reloaded characters. 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...
 
- 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...
 
- 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 that only fires when you walk through in a certain direction (with a minimum speed).

Member Function Documentation

◆ CheckMoveThrough()

virtual void PlatformerPro.OneWayTrigger.CheckMoveThrough ( )
protectedvirtual

Checks the move through.

◆ PostInit()

override void PlatformerPro.OneWayTrigger.PostInit ( )
protectedvirtual

Initialise the sensor.

Reimplemented from PlatformerPro.PersistableObject.

Member Data Documentation

◆ charactersOnTriggeringSide

List<Character> PlatformerPro.OneWayTrigger.charactersOnTriggeringSide
protected

Characters to left.

◆ height

float PlatformerPro.OneWayTrigger.height

The height. Note that height is evaluated against the position of the characters transform (it doesn't take character height in to account).

◆ isUpAndDownTrigger

bool PlatformerPro.OneWayTrigger.isUpAndDownTrigger
protected

If we are rotated by 90 degrees the trigger is up to down or down to up, instead of left to right/right to left.

◆ Proximity

const float PlatformerPro.OneWayTrigger.Proximity = 0.5f
staticprotected

How close before we start tracking the cahracter. Larger numbers support higher speeds, but have more performance cost.

◆ velocity

float PlatformerPro.OneWayTrigger.velocity

The required velocity (speed and direction). Use 'speed < 0' for right to left, and 'speed > 0' for left to right.


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