2022-05-23 18:41:30 +00:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "AbilitySystem/Abilities/LyraGameplayAbility.h"
|
2022-09-13 07:18:28 +00:00
|
|
|
#include "Containers/Array.h"
|
|
|
|
#include "GameplayAbilitySpec.h"
|
|
|
|
#include "Interaction/InteractionOption.h"
|
|
|
|
#include "UObject/SoftObjectPtr.h"
|
|
|
|
#include "UObject/UObjectGlobals.h"
|
|
|
|
|
2022-05-23 18:41:30 +00:00
|
|
|
#include "LyraGameplayAbility_Interact.generated.h"
|
|
|
|
|
|
|
|
class UIndicatorDescriptor;
|
2022-09-13 07:18:28 +00:00
|
|
|
class UObject;
|
|
|
|
class UUserWidget;
|
|
|
|
struct FFrame;
|
|
|
|
struct FGameplayAbilityActorInfo;
|
|
|
|
struct FGameplayEventData;
|
2022-05-23 18:41:30 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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()
|
2022-09-13 07:18:28 +00:00
|
|
|
TArray<TObjectPtr<UIndicatorDescriptor>> Indicators;
|
2022-05-23 18:41:30 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
UPROPERTY(EditDefaultsOnly)
|
|
|
|
float InteractionScanRate = 0.1f;
|
|
|
|
|
|
|
|
UPROPERTY(EditDefaultsOnly)
|
|
|
|
float InteractionScanRange = 500;
|
|
|
|
|
|
|
|
UPROPERTY(EditDefaultsOnly)
|
|
|
|
TSoftClassPtr<UUserWidget> DefaultInteractionWidgetClass;
|
|
|
|
};
|