RealtimeStyleTransferRuntime/Source/LyraGame/Interaction/Abilities/LyraGameplayAbility_Interact.h

61 lines
1.6 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "AbilitySystem/Abilities/LyraGameplayAbility.h"
#include "Containers/Array.h"
#include "GameplayAbilitySpec.h"
#include "Interaction/InteractionOption.h"
#include "UObject/SoftObjectPtr.h"
#include "UObject/UObjectGlobals.h"
#include "LyraGameplayAbility_Interact.generated.h"
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;
};