Show / Hide Table of Contents

Class EventListener

Used for listening in on any events sent from and to objects in the game. Also works with PlaymakerFSM events

Inheritance
object
Object
Component
Behaviour
MonoBehaviour
EventListener
Namespace: WeaverCore
Assembly: WeaverCore.dll
Syntax
public class EventListener : MonoBehaviour

Methods

| Edit this page View Source

Awake()

Declaration
protected virtual void Awake()
| Edit this page View Source

ListenForEvent(string, EventListenerDelegate)

Listens for a specific event fired from any object

Declaration
public uint ListenForEvent(string eventName, EventListener.EventListenerDelegate action)
Parameters
Type Name Description
string eventName

The event to listen for

EventListener.EventListenerDelegate action

The action that is called when the event is fired

Returns
Type Description
uint

Returns the unique id for the listener. This ID can be used to remove the listener via RemoveListener(uint)

| Edit this page View Source

ListenForEvent(EventListenerWithNameDelegate)

Adds an event listener to listen for an event

Declaration
public uint ListenForEvent(EventListener.EventListenerWithNameDelegate action)
Parameters
Type Name Description
EventListener.EventListenerWithNameDelegate action

The action to be triggered when an event is fired

Returns
Type Description
uint

Returns the unique id for the listener. This ID can be used to remove the listener via RemoveListener(uint)

| Edit this page View Source

OnDestroy()

Declaration
protected virtual void OnDestroy()
| Edit this page View Source

OnDisable()

Declaration
protected virtual void OnDisable()
| Edit this page View Source

OnEnable()

Declaration
protected virtual void OnEnable()
| Edit this page View Source

OnEventSent(string, GameObject, GameObject, EventType)

Triggered when any event gets sent

Declaration
protected virtual void OnEventSent(string eventName, GameObject source, GameObject destination, EventManager.EventType eventType)
Parameters
Type Name Description
string eventName

The event that was sent

GameObject source

The object sending the event

GameObject destination

The object receiving the event

EventManager.EventType eventType

The type of event that was sent

| Edit this page View Source

RemoveListener(uint)

Removes a listener from listening to a certain event

Declaration
public void RemoveListener(uint ID)
Parameters
Type Name Description
uint ID

The id of the listener to remove

Extension Methods

ReflectionUtilities.ReflectCallMethod(object, string, object[], BindingFlags)
ReflectionUtilities.ReflectGetField(object, string, BindingFlags)
ReflectionUtilities.ReflectGetMethod(object, string, BindingFlags)
ReflectionUtilities.ReflectGetProperty(object, string, BindingFlags)
ReflectionUtilities.ReflectSetField(object, string, object, BindingFlags)
ReflectionUtilities.ReflectSetProperty(object, string, object, BindingFlags)
CoroutineUtilities.RunCoroutineWhile<T>(T, IEnumerator, Func<bool>)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Generated by DocFX
☀
☾