50 lines
1.7 KiB
C++
Executable file
50 lines
1.7 KiB
C++
Executable file
#pragma once
|
|
#include "CoreMinimal.h"
|
|
#include "DamageAttackComponent.h"
|
|
#include "MeleeAttackDelegateDelegate.h"
|
|
#include "MeleeAttackComponent.generated.h"
|
|
|
|
class UAnimMontage;
|
|
class UAttackEffect;
|
|
class UTargetValidator;
|
|
|
|
UCLASS(Blueprintable, ClassGroup=Custom, meta=(BlueprintSpawnableComponent))
|
|
class UMeleeAttackComponent : public UDamageAttackComponent {
|
|
GENERATED_BODY()
|
|
public:
|
|
protected:
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
TArray<UAnimMontage*> Montages;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Instanced, meta=(AllowPrivateAccess=true))
|
|
UTargetValidator* HitValidator;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
bool CenterOnTarget;
|
|
|
|
UPROPERTY(BlueprintReadWrite, EditAnywhere, Instanced, meta=(AllowPrivateAccess=true))
|
|
TArray<UAttackEffect*> AttackEffects;
|
|
|
|
UPROPERTY(BlueprintAssignable, BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
FMeleeAttackDelegate OnAttackStartedEvent;
|
|
|
|
UPROPERTY(BlueprintAssignable, BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
FMeleeAttackDelegate OnDamageAppliedEvent;
|
|
|
|
UPROPERTY(BlueprintAssignable, BlueprintReadWrite, EditAnywhere, meta=(AllowPrivateAccess=true))
|
|
FMeleeAttackDelegate OnAttackEndedEvent;
|
|
|
|
public:
|
|
UMeleeAttackComponent();
|
|
protected:
|
|
UFUNCTION(BlueprintCallable, BlueprintNativeEvent)
|
|
UAnimMontage* SelectMontage() const;
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
void OnPerformAttack(FName Name);
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
void OnMontageEnded(UAnimMontage* Montage, bool interrupted);
|
|
|
|
};
|
|
|