Class GameEventListenerGeneric2<T, U>
- Namespace
- ElectricDrill.SoapRpgFramework.Events
- Assembly
- com.electricdrill.soap-rpg-framework.Runtime.dll
MonoBehaviour component that listens to GameEventGeneric2 objects and responds with UnityEvents. Automatically registers and unregisters itself when enabled/disabled.
public class GameEventListenerGeneric2<T, U> : MonoBehaviour
Type Parameters
TThe type of the first parameter the listened event carries.
UThe type of the second parameter the listened event carries.
- Inheritance
-
objectGameEventListenerGeneric2<T, U>
- Derived
Fields
_event
[SerializeField]
protected GameEventGeneric2<T, U> _event
Field Value
- GameEventGeneric2<T, U>
_response
[SerializeField]
protected UnityEvent<T, U> _response
Field Value
- UnityEvent<T, U>
Methods
OnEventRaised(T, U)
Called by the GameEvent when it is raised. Invokes the configured UnityEvent response with the provided contexts.
public void OnEventRaised(T contextT, U contextU)
Parameters
contextTTThe first parameter passed from the event.
contextUUThe second parameter passed from the event.