What is the purpose of the Object parameter here?
UInputComponent.BindAction(..., UserClass* Object, ...)
What information should I pass here?
What is the purpose of the Object parameter here?
UInputComponent.BindAction(..., UserClass* Object, ...)
What information should I pass here?
The full signature is:
template<class UserClass>
FInputActionBinding & BindAction
(
const FName ActionName,
const EInputEvent KeyEvent,
UserClass * Object,
typename FInputActionHandlerSignature::TUObjectMethodDelegate< UserClass >::FMethodPtr Func
)
This shows that UserClass
is a template parameters and that TUObjectMethodDelegate
uses that parameter as well. TUObjectMethodDelegate
looks to be a helper to encapsulate member functions of the template parameter type.
This means that Object is the instance object on which the passed delegate is invoked.
Which is a long winded way of saying it's unreal's typesafe alternative to a void* userData
parameter commonly found in callback frameworks.