I’m wondering is there a good way for my c++ class to provide a unified event-like API for both c++ classes and blueprints.
Example: I have ACannon class and I want to define OnFire member that both classes and blueprints can bind to.
For other classes - I can use a dynamic delegate as described here: https://docs.unrealengine.com/en-us/…legates/Events and this way I’m able to bind multiple c++ methods/functions to OnFire.
For blueprints - I can use either BlueprintNativeEvent or BlueprintImplementableEvent in UFUNCTION, and then I’m able to bind multiple behaviours to OnFire in any number of blueprint graphs.
Unfortunately, I cannot combine the two mentioned solutions. That is: I cannot apply the UFUNCTION to the dynamic delegate. It seems that for each event (like OnFire) I need to define two separate class members - one for c++ and another for blueprints.
Is there a way to provide an event for c++ and blueprint using a single class member?
I found that the BlueprintAssignable UPROPERTY specifier almost does what I want. Except it only works for multicast-delegates, and not for events. Is there any way to expose an event to blueprints?