API reference
API reference
Select your platform
No SDKs available
No versions available

UnityEventExtensions Class

A static extension class that provides single line implementation for adding or removing UnityEvent listeners

Static Methods

SetListener ( baseEvent , call , add )
Either adds or removes a call action with no parameters based on the provided boolean
Signature
static void Meta.WitAi.UnityEventExtensions.SetListener(this UnityEvent baseEvent, UnityAction call, bool add)
Parameters
baseEvent: this UnityEvent  The base event for the action to be
call: UnityAction  The action to be called when baseEvent is invoked
add: bool  If true, the action is added as a listener. If false, it is removed.
Returns
void
SetListener< T > ( baseEvent , call , add )
Either adds or removes a call action with a single parameter based on the provided boolean
Signature
static void Meta.WitAi.UnityEventExtensions.SetListener< T >(this UnityEvent< T > baseEvent, UnityAction< T > call, bool add)
Parameters
baseEvent: this UnityEvent< T >  The base event for the action to be
call: UnityAction< T >  The action to be called when baseEvent is invoked
add: bool  If true, the action is added as a listener. If false, it is removed.
Returns
void
SetListener< T0, T1 > ( baseEvent , call , add )
Either adds or removes a call action with two parameters based on the provided boolean
Signature
static void Meta.WitAi.UnityEventExtensions.SetListener< T0, T1 >(this UnityEvent< T0, T1 > baseEvent, UnityAction< T0, T1 > call, bool add)
Parameters
baseEvent: this UnityEvent< T0, T1 >  The base event for the action to be
call: UnityAction< T0, T1 >  The action to be called when baseEvent is invoked
add: bool  If true, the action is added as a listener. If false, it is removed.
Returns
void
SetListener< T0, T1, T2 > ( baseEvent , call , add )
Either adds or removes a call action with three parameters based on the provided boolean
Signature
static void Meta.WitAi.UnityEventExtensions.SetListener< T0, T1, T2 >(this UnityEvent< T0, T1, T2 > baseEvent, UnityAction< T0, T1, T2 > call, bool add)
Parameters
baseEvent: this UnityEvent< T0, T1, T2 >  The base event for the action to be
call: UnityAction< T0, T1, T2 >  The action to be called when baseEvent is invoked
add: bool  If true, the action is added as a listener. If false, it is removed.
Returns
void
SetListener< T0, T1, T2, T3 > ( baseEvent , call , add )
Either adds or removes a call action with four parameters based on the provided boolean
Signature
static void Meta.WitAi.UnityEventExtensions.SetListener< T0, T1, T2, T3 >(this UnityEvent< T0, T1, T2, T3 > baseEvent, UnityAction< T0, T1, T2, T3 > call, bool add)
Parameters
baseEvent: this UnityEvent< T0, T1, T2, T3 >  The base event for the action to be
call: UnityAction< T0, T1, T2, T3 >  The action to be called when baseEvent is invoked
add: bool  If true, the action is added as a listener. If false, it is removed.
Returns
void