5#include "CoreMinimal.h"
6#include "Components/ActorComponent.h"
8#include "GameplayTagContainer.h"
9#include "WeaponLoadoutComponent.generated.h"
11class UAbilitySystemComponent;
12class UAudioEmitterComponent;
18UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent))
19class CK_UE_API UWeaponLoadoutComponent :
public UActorComponent
24 UWeaponLoadoutComponent();
27 bool EquipWeapon(const FGameplayTag& WeaponTag);
28 bool SwapWeapon(const FGameplayTag& WeaponTag);
29 void UnequipCurrent();
30 void ResetSkillCooldowns();
33 FOnWeaponChanged OnWeaponChanged;
36 FORCEINLINE FGameplayTag GetCurrentWeaponTag()
const
38 return CurrentWeaponTag;
43 return CurrentDefinition;
47 virtual void BeginPlay()
override;
48 virtual void EndPlay(
const EEndPlayReason::Type EndPlayReason)
override;
50 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category =
"Weapon")
54 bool ApplyWeapon(const FGameplayTag& WeaponTag,
bool bActivateSwapInSkill);
64 void ClearAudioData();
65 void ActivateSwapInSkill(
UWeaponDefinition* Definition, FGameplayAbilitySpecHandle SwapInSkillHandle);
67 UAudioEmitterComponent* GetWeaponAudioTagComponent();
70 UAbilitySystemComponent* GetASC() const;
78 FGameplayTag CurrentWeaponTag;
86 TWeakObjectPtr<UAbilitySystemComponent> CachedASC;
89 TWeakObjectPtr<UAudioEmitterComponent> CachedWeaponAudioTagComponent;
DECLARE_MULTICAST_DELEGATE_TwoParams(FOnWeaponChanged, const FGameplayTag &, const FGameplayTag &)
Definition WeaponDefinition.h:77
Definition GrantedHandles.h:24