RealtimeStyleTransferRuntime/Source/LyraGame/Interaction/Tasks/AbilityTask_GrantNearbyInte...

41 lines
1.3 KiB
C
Raw Normal View History

2022-05-23 18:41:30 +00:00
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Abilities/Tasks/AbilityTask.h"
2022-09-13 07:18:28 +00:00
#include "Containers/Map.h"
#include "Engine/EngineTypes.h"
#include "UObject/UObjectGlobals.h"
2022-05-23 18:41:30 +00:00
#include "AbilityTask_GrantNearbyInteraction.generated.h"
2022-09-13 07:18:28 +00:00
class UGameplayAbility;
class UObject;
struct FFrame;
struct FGameplayAbilitySpecHandle;
struct FObjectKey;
2022-05-23 18:41:30 +00:00
UCLASS()
class UAbilityTask_GrantNearbyInteraction : public UAbilityTask
{
GENERATED_UCLASS_BODY()
virtual void Activate() override;
/** Wait until an overlap occurs. This will need to be better fleshed out so we can specify game specific collision requirements */
UFUNCTION(BlueprintCallable, Category="Ability|Tasks", meta = (HidePin = "OwningAbility", DefaultToSelf = "OwningAbility", BlueprintInternalUseOnly = "TRUE"))
static UAbilityTask_GrantNearbyInteraction* GrantAbilitiesForNearbyInteractors(UGameplayAbility* OwningAbility, float InteractionScanRange, float InteractionScanRate);
private:
virtual void OnDestroy(bool AbilityEnded) override;
void QueryInteractables();
float InteractionScanRange = 100;
float InteractionScanRate = 0.100;
FTimerHandle QueryTimerHandle;
TMap<FObjectKey, FGameplayAbilitySpecHandle> InteractionAbilityCache;
};