5#include "Components/ActorComponent.h"
6#include "ChargeStateComponent.generated.h"
14UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
22 void BeginCharge(
const TArray<float>& InPhaseDurations);
24 void ChangePhase(int32 InNewPhase);
28 float GetProgressValue()
const;
30 FORCEINLINE
bool IsCharging()
const {
return bIsCharging; }
34 FORCEINLINE int32
GetMaxPhase()
const {
return PhaseDurations.Num(); }
38 FOnChargeBeginDelegate OnChargeBegin;
41 FOnChargePhaseChangedDelegate OnChargePhaseChanged;
44 FOnChargeEndDelegate OnChargeEnd;
48 TArray<
float> PhaseDurations;
51 int32 CurrentPhase = 0;
54 float PhaseStartWorldTime = 0.0f;
57 float CurrentPhaseDuration = 0.0f;
60 uint8 bIsCharging : 1;
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnChargePhaseChangedDelegate, int32, NewPhase)
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnChargeBeginDelegate)
Definition ChargeStateComponent.h:16
FORCEINLINE bool IsCharging() const
Definition ChargeStateComponent.h:30
FORCEINLINE int32 GetCurrentPhase() const
Definition ChargeStateComponent.h:32
FORCEINLINE int32 GetMaxPhase() const
Definition ChargeStateComponent.h:34