Hey,
I stumbled on this post when trying to achieve the same thing and I finally found a solution 
Here is FMyDelegateSignature
declaration :
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FMyDelegateSignature, const FMyEvent &, Event);
Then, the tricky part, when you need to put the function pointer as a parameter; hopefully Unreal comes with something to achieve this, and I’m passing the parameters to __Internal_AddUniqueDynamic()
to do the binding :
template<typename UserClass>
void AddGlobalEventListener(const FName& EventName, UserClass* Owner, typename FMyDelegateSignature::FDelegate::TMethodPtrResolver<UserClass>::FMethodPtr InMethodPtr, FName FuncName)
{
check(Owner)
UE_LOG(LogUGC, Log, TEXT("Add Global Event Listener for %s : %s"), *EventName.ToString(), *FuncName.ToString());
FMyDelegateSignature& Signature = GetGlobalEvent(EventName);
Signature.__Internal_AddUniqueDynamic(Owner, InMethodPtr, FuncName);
}
The function can be called like this
MyObject->AddGlobalEventListener(GlobalEventName, this, &UAction::ExecuteAction, TEXT("ExecuteAction"));
But you can define a macro like AddDynamic()
to be more elegant :
#define AddGlobalEvent(EventName, UserObject, FuncName) AddGlobalEventListener(EventName, UserObject, FuncName, STATIC_FUNCTION_FNAME( TEXT( #FuncName ) ) )
And you can call your function like this
MyObject->AddGlobalEvent(GlobalEventName, this, &UAction::ExecuteAction);
And voilà ! I hope it helps !