Transformed OnHit to delegate
Signed-off-by: TjgL <lithmoneo@gmail.com>
This commit is contained in:
parent
b69db53351
commit
db589dc845
BIN
Content/Legumix/Ennemy/BP_HealthComponent.uasset
(Stored with Git LFS)
BIN
Content/Legumix/Ennemy/BP_HealthComponent.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Legumix/Player/BP_Play.uasset
(Stored with Git LFS)
BIN
Content/Legumix/Player/BP_Play.uasset
(Stored with Git LFS)
Binary file not shown.
@ -58,7 +58,7 @@ void ULMHealthComponent::Kill()
|
|||||||
void ULMHealthComponent::HitBoxHit(ULMHitBox* HitBox, const float Damage, const FVector& Origin, const FHitResult& HitInfo)
|
void ULMHealthComponent::HitBoxHit(ULMHitBox* HitBox, const float Damage, const FVector& Origin, const FHitResult& HitInfo)
|
||||||
{
|
{
|
||||||
TakeDamage(Damage);
|
TakeDamage(Damage);
|
||||||
OnHit(Damage, Origin, HitInfo);
|
OnHit.Broadcast(Damage, Origin, HitInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ class LEGUMEMIX_API ULMHealthComponent : public UActorComponent
|
|||||||
|
|
||||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnHealthChangedSignature, float, Health, float, Damage);
|
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnHealthChangedSignature, float, Health, float, Damage);
|
||||||
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnDeathSignature);
|
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnDeathSignature);
|
||||||
|
DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnHitSignature, float, Damage, const FVector&, Origin, const FHitResult&, HitInfo);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ULMHealthComponent();
|
ULMHealthComponent();
|
||||||
@ -78,8 +79,8 @@ public:
|
|||||||
* @param Origin The origin of the damage.
|
* @param Origin The origin of the damage.
|
||||||
* @param HitInfo The collisions informations.
|
* @param HitInfo The collisions informations.
|
||||||
*/
|
*/
|
||||||
UFUNCTION(BlueprintImplementableEvent, Category=Legumix, meta=(Keywords = "Refill"))
|
UPROPERTY(BlueprintCallable, BlueprintAssignable, Category=Legumix)
|
||||||
void OnHit(float Damage, const FVector& Origin, const FHitResult& HitInfo);
|
FOnHitSignature OnHit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Completely refill the health of the component.
|
* Completely refill the health of the component.
|
||||||
|
Reference in New Issue
Block a user