How it works...

When we bind the function to the delegate, we specify some additional data (in this case, a Boolean of value false). You can pass up to four "payload" variables in this fashion. They are applied to your function after any parameters are declared in the DECLARE_DELEGATE_* macro that you used.

We change the function signature of our delegate so that it can accept the extra argument.

Inside the function, we use the extra argument to turn the light on or off, depending on the value being true or false at compile time.

We don't need to change the call to ExecuteIfBoundthe delegate system automatically applies the delegate parameters, which are passed in through ExecuteIfBound first. It then applies any payload parameters, which are always specified after the function reference in a call to BindUObject.