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

Overview

Static Public Member Functions

static void
SetListener
( this UnityEvent baseEvent,
UnityAction call,
bool add )
Either adds or removes a call action with no parameters based on the provided boolean
static void
SetListener< T >
( this UnityEvent< T > baseEvent,
UnityAction< T > call,
bool add )
Either adds or removes a call action with a single parameter based on the provided boolean
static void
SetListener< T0, T1 >
( this UnityEvent< T0, T1 > baseEvent,
UnityAction< T0, T1 > call,
bool add )
Either adds or removes a call action with two parameters based on the provided boolean
static void
SetListener< T0, T1, T2 >
( this UnityEvent< T0, T1, T2 > baseEvent,
UnityAction< T0, T1, T2 > call,
bool add )
Either adds or removes a call action with three parameters based on the provided boolean
static void
SetListener< T0, T1, T2, T3 >
( this UnityEvent< T0, T1, T2, T3 > baseEvent,
UnityAction< T0, T1, T2, T3 > call,
bool add )
Either adds or removes a call action with four parameters based on the provided boolean

Details

Static Member Functions

static void Meta.WitAi.UnityEventExtensions.SetListener
( this UnityEvent baseEvent,
UnityAction call,
bool add )
Either adds or removes a call action with no parameters based on the provided boolean
Parameters
baseEvent
The base event for the action to be
call
The action to be called when baseEvent is invoked
add
If true, the action is added as a listener. If false, it is removed.
static void Meta.WitAi.UnityEventExtensions.SetListener< T >
( this UnityEvent< T > baseEvent,
UnityAction< T > call,
bool add )
Either adds or removes a call action with a single parameter based on the provided boolean
Parameters
baseEvent
The base event for the action to be
call
The action to be called when baseEvent is invoked
add
If true, the action is added as a listener. If false, it is removed.
static void Meta.WitAi.UnityEventExtensions.SetListener< T0, T1 >
( this UnityEvent< T0, T1 > baseEvent,
UnityAction< T0, T1 > call,
bool add )
Either adds or removes a call action with two parameters based on the provided boolean
Parameters
baseEvent
The base event for the action to be
call
The action to be called when baseEvent is invoked
add
If true, the action is added as a listener. If false, it is removed.
static void Meta.WitAi.UnityEventExtensions.SetListener< T0, T1, T2 >
( this UnityEvent< T0, T1, T2 > baseEvent,
UnityAction< T0, T1, T2 > call,
bool add )
Either adds or removes a call action with three parameters based on the provided boolean
Parameters
baseEvent
The base event for the action to be
call
The action to be called when baseEvent is invoked
add
If true, the action is added as a listener. If false, it is removed.
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 )
Either adds or removes a call action with four parameters based on the provided boolean
Parameters
baseEvent
The base event for the action to be
call
The action to be called when baseEvent is invoked
add
If true, the action is added as a listener. If false, it is removed.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon