Multiplayer Game
•
Implement the Health Component:
MyHealthComponent.h
DECLARE_DYNAMIC_MULTICAST_DELEGATE_SixParams(FOnHealthChangedSignature,
UMyHealthComponent*, HealthComponent, float, health, float,
damage, const class UDamageType*, DamageType, class
AController*, InstigatedBy, AActor*, DamageCauser);
...
protected:
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Health")
float Health;
UFUNCTION()
void OnTakeDamage(AActor* DamagedActor, float Damage, const class
UDamageType* DamageType, class AController* InstigatedBy,
AActor* DamageCauser);
.
..
public:
UPROPERTY(BlueprintAssignable, Category = "Events")
FOnHealthChangedSignature OnHealthChangedEvent;