I have a delegate MyDelegate
separated into Native and BP version like this :
UDELEGATE()
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FMyDelegateBP, int32, FirstVar);
DECLARE_MULTICAST_DELEGATE_OneParam(FMyDelegate, int32 /* FirstVar */);
UPROPERTY(BlueprintAssignable, BlueprintCallable)
FMyDelegateBP MyDelegateBP;
FMyDelegate MyDelegate;
void AMyCharacter::MyFunction() {
if (MyDelegateBP.IsBound()) { // Should I be checking this?
MyDelegateBP.Broadcast(100);
}
if (MyDelegate.IsBound()) { // and this?
MyDelegate.Broadcast(100);
}
}
Is it necessary to check with IsBound()
or can I directly broadcast?
Also is IsBound()
already checked internally in Broadcast()
hence making this extra check redundant ?