unitysamples / LyraStarterGame /Source /LyraGame /Interaction /Abilities /LyraGameplayAbility_Interact.h
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| class UIndicatorDescriptor; | |
| class UObject; | |
| class UUserWidget; | |
| struct FFrame; | |
| struct FGameplayAbilityActorInfo; | |
| struct FGameplayEventData; | |
| /** | |
| * ULyraGameplayAbility_Interact | |
| * | |
| * Gameplay ability used for character interacting | |
| */ | |
| UCLASS(Abstract) | |
| class ULyraGameplayAbility_Interact : public ULyraGameplayAbility | |
| { | |
| GENERATED_BODY() | |
| public: | |
| ULyraGameplayAbility_Interact(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); | |
| virtual void ActivateAbility(const FGameplayAbilitySpecHandle Handle, const FGameplayAbilityActorInfo* ActorInfo, const FGameplayAbilityActivationInfo ActivationInfo, const FGameplayEventData* TriggerEventData) override; | |
| UFUNCTION(BlueprintCallable) | |
| void UpdateInteractions(const TArray<FInteractionOption>& InteractiveOptions); | |
| UFUNCTION(BlueprintCallable) | |
| void TriggerInteraction(); | |
| protected: | |
| UPROPERTY(BlueprintReadWrite) | |
| TArray<FInteractionOption> CurrentOptions; | |
| UPROPERTY() | |
| TArray<TObjectPtr<UIndicatorDescriptor>> Indicators; | |
| protected: | |
| UPROPERTY(EditDefaultsOnly) | |
| float InteractionScanRate = 0.1f; | |
| UPROPERTY(EditDefaultsOnly) | |
| float InteractionScanRange = 500; | |
| UPROPERTY(EditDefaultsOnly) | |
| TSoftClassPtr<UUserWidget> DefaultInteractionWidgetClass; | |
| }; | |