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

Use this component to do something when an event occurs. For example play a sound or particle effect. More...

Inheritance diagram for PlatformerPro.EventResponder:
PlatformerPro.GenericResponder PlatformerPro.PlatformerProMonoBehaviour

Public Attributes

bool loadedCharacters
 Listen to events from characters loaded in to the scene. More...
 
GameObject sender
 Listen to only this game object. If its null listen to all. More...
 
string typeName
 The name of the type to listen to (for example Enemy or Character). More...
 
string eventName
 The name of the event to listen to. More...
 
EventResponse[] actions
 What to do when the event is received. More...
 
AnimationState animationStateFilter
 If the event is an animation change only trigger the event if this filter criteria is met. More...
 
DamageType damageTypeFilter
 If the event is a damage or death only trigger the event if this filter criteria is met. More...
 
ButtonState buttonStateFilter
 If the event is an button change only trigger the event if this filter criteria is met. More...
 
string stringFilter
 If the event is an attack only trigger event if attack name matches this. More...
 
int intFilter
 If the event is an integer event, or an item event with an amount. More...
 
int altIntFilter = -1
 If we need an additional int filter. More...
 
GamePhase gamePhaseFilter = GamePhase.NONE
 If the event is an game phase change only trigger event if phase matches this. If it is any other event only apply if this == NONE or the game amanger GamePhase is equal to this. More...
 

Protected Member Functions

virtual void Init ()
 Initialise this responder. More...
 
virtual void AddHandler (GameObject sendingGameObject)
 Adds the event handler. More...
 
virtual void RemoveHandler ()
 Removes the event handler. More...
 
virtual void HandleEvent (object sender, System.EventArgs args)
 Handles the event. More...
 
virtual bool ApplyFilters (EventResponse action, System.EventArgs args)
 Applies the filters. More...
 
override void DoImmediateAction (EventResponse action, System.EventArgs args)
 Do the action More...
 
- Protected Member Functions inherited from PlatformerPro.GenericResponder
virtual void DoAction (EventResponse action, System.EventArgs args)
 Handles the event. More...
 
virtual IEnumerator DoDelayedAction (EventResponse action, System.EventArgs args)
 Do the action after a delay. More...
 
Character GetCharacter (EventResponse action, System.EventArgs args)
 Gets a character reference from an action or event. More...
 

Protected Attributes

System.Reflection.EventInfo eventInfo
 Cached event info. More...
 
System.Delegate handler
 Cached handler . More...
 
Component sendingComponent
 Cached sending component. More...
 
float handleTimer
 When this gets to zero do the action. More...
 
CustomEventFilter[] customFilters
 

Properties

override string Header [get]
 
override string DocLink [get]
 
- 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.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...
 

Detailed Description

Use this component to do something when an event occurs. For example play a sound or particle effect.

Member Function Documentation

◆ AddHandler()

virtual void PlatformerPro.EventResponder.AddHandler ( GameObject  sendingGameObject)
protectedvirtual

Adds the event handler.

◆ ApplyFilters()

virtual bool PlatformerPro.EventResponder.ApplyFilters ( EventResponse  action,
System.EventArgs  args 
)
protectedvirtual

Applies the filters.

Returns
true, if filtering was passed, false otherwise.
Parameters
actionAction.
argsArguments.

◆ DoImmediateAction()

override void PlatformerPro.EventResponder.DoImmediateAction ( EventResponse  action,
System.EventArgs  args 
)
protectedvirtual

Do the action

Parameters
argsEvent arguments.
actionAction.

Reimplemented from PlatformerPro.GenericResponder.

◆ HandleEvent()

virtual void PlatformerPro.EventResponder.HandleEvent ( object  sender,
System.EventArgs  args 
)
protectedvirtual

Handles the event.

Parameters
senderSender.
argsArguments.

◆ Init()

virtual void PlatformerPro.EventResponder.Init ( )
protectedvirtual

Initialise this responder.

◆ RemoveHandler()

virtual void PlatformerPro.EventResponder.RemoveHandler ( )
protectedvirtual

Removes the event handler.

Member Data Documentation

◆ actions

EventResponse [] PlatformerPro.EventResponder.actions

What to do when the event is received.

◆ altIntFilter

int PlatformerPro.EventResponder.altIntFilter = -1

If we need an additional int filter.

◆ animationStateFilter

AnimationState PlatformerPro.EventResponder.animationStateFilter

If the event is an animation change only trigger the event if this filter criteria is met.

◆ buttonStateFilter

ButtonState PlatformerPro.EventResponder.buttonStateFilter

If the event is an button change only trigger the event if this filter criteria is met.

◆ customFilters

CustomEventFilter [] PlatformerPro.EventResponder.customFilters
protected

◆ damageTypeFilter

DamageType PlatformerPro.EventResponder.damageTypeFilter

If the event is a damage or death only trigger the event if this filter criteria is met.

◆ eventInfo

System.Reflection.EventInfo PlatformerPro.EventResponder.eventInfo
protected

Cached event info.

◆ eventName

string PlatformerPro.EventResponder.eventName

The name of the event to listen to.

◆ gamePhaseFilter

GamePhase PlatformerPro.EventResponder.gamePhaseFilter = GamePhase.NONE

If the event is an game phase change only trigger event if phase matches this. If it is any other event only apply if this == NONE or the game amanger GamePhase is equal to this.

◆ handler

System.Delegate PlatformerPro.EventResponder.handler
protected

Cached handler .

◆ handleTimer

float PlatformerPro.EventResponder.handleTimer
protected

When this gets to zero do the action.

◆ intFilter

int PlatformerPro.EventResponder.intFilter

If the event is an integer event, or an item event with an amount.

◆ loadedCharacters

bool PlatformerPro.EventResponder.loadedCharacters

Listen to events from characters loaded in to the scene.

◆ sender

GameObject PlatformerPro.EventResponder.sender

Listen to only this game object. If its null listen to all.

◆ sendingComponent

Component PlatformerPro.EventResponder.sendingComponent
protected

Cached sending component.

◆ stringFilter

string PlatformerPro.EventResponder.stringFilter

If the event is an attack only trigger event if attack name matches this.

◆ typeName

string PlatformerPro.EventResponder.typeName

The name of the type to listen to (for example Enemy or Character).

Property Documentation

◆ DocLink

override string PlatformerPro.EventResponder.DocLink
get

◆ Header

override string PlatformerPro.EventResponder.Header
get

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