Hello everyone,
So for further clarification, I am AWARE of EVENT. But I’m not sure how it can be used in the following scenario: I’d like to be able to bind to these delegates from both blueprint and cpp side BUT at the same time I’d like to refrain other classes(blueprint or cpp) from invoking the broadcast method of the delegate. The following snippet(slightly hacky) works almost but not quite in that it does not hide the broadcast method in cpp side.This is of course what I was expecting but I’d like to know if we can achieve what I described above using an alternate way(maybe events?).
Here is the code :
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnBrightnessValueChanged, float, Brightness);
...
...
public:
UPROPERTY(BlueprintAssignable, Category = "C++")
FOnBrightnessValueChanged OnBrightenessValueChanged;
...
...
protected:
// One could use BlueprintCallable for the delegates defined above.
// That exposes it to every blueprint. A workaround is to define a protected method
// which calls the Broadcast method of the delegate.
UFUNCTION(BlueprintCallable, Category = "C++", meta = (BlueprintProtected))
void CallOnBrightnessValueChanged(float Value) { OnBrightenessValueChanged.Broadcast(Value); }