2022-05-23 18:41:30 +00:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Components/ActorComponent.h"
|
2022-09-13 07:18:28 +00:00
|
|
|
#include "Containers/Array.h"
|
|
|
|
#include "Containers/Set.h"
|
|
|
|
#include "Engine/EngineTypes.h"
|
2022-05-23 18:41:30 +00:00
|
|
|
#include "GameplayTagContainer.h"
|
|
|
|
#include "LyraContextEffectsInterface.h"
|
2022-09-13 07:18:28 +00:00
|
|
|
#include "Math/MathFwd.h"
|
|
|
|
#include "Math/Rotator.h"
|
|
|
|
#include "Math/Vector.h"
|
|
|
|
#include "UObject/NameTypes.h"
|
2022-05-23 18:41:30 +00:00
|
|
|
#include "UObject/SoftObjectPtr.h"
|
2022-09-13 07:18:28 +00:00
|
|
|
#include "UObject/UObjectGlobals.h"
|
|
|
|
|
2022-05-23 18:41:30 +00:00
|
|
|
#include "LyraContextEffectComponent.generated.h"
|
|
|
|
|
2022-09-13 07:18:28 +00:00
|
|
|
class UAnimSequenceBase;
|
|
|
|
class UAudioComponent;
|
2022-05-23 18:41:30 +00:00
|
|
|
class ULyraContextEffectsLibrary;
|
|
|
|
class UNiagaraComponent;
|
2022-09-13 07:18:28 +00:00
|
|
|
class UObject;
|
|
|
|
class USceneComponent;
|
|
|
|
struct FFrame;
|
|
|
|
struct FHitResult;
|
2022-05-23 18:41:30 +00:00
|
|
|
|
|
|
|
UCLASS( ClassGroup=(Custom), hidecategories = (Variable, Tags, ComponentTick, ComponentReplication, Activation, Cooking, AssetUserData, Collision), CollapseCategories, meta=(BlueprintSpawnableComponent) )
|
|
|
|
class LYRAGAME_API ULyraContextEffectComponent : public UActorComponent, public ILyraContextEffectsInterface
|
|
|
|
{
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Sets default values for this component's properties
|
|
|
|
ULyraContextEffectComponent();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// Called when the game starts
|
|
|
|
virtual void BeginPlay() override;
|
|
|
|
|
|
|
|
// Called when the game ends
|
|
|
|
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
|
|
|
|
|
|
|
|
public:
|
|
|
|
// AnimMotionEffect Implementation
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
|
|
virtual void AnimMotionEffect_Implementation(const FName Bone, const FGameplayTag MotionEffect, USceneComponent* StaticMeshComponent,
|
|
|
|
const FVector LocationOffset, const FRotator RotationOffset, const UAnimSequenceBase* AnimationSequence,
|
|
|
|
const bool bHitSuccess, const FHitResult HitResult, FGameplayTagContainer Contexts,
|
|
|
|
FVector VFXScale = FVector(1), float AudioVolume = 1, float AudioPitch = 1) override;
|
|
|
|
|
|
|
|
// Auto-Convert Physical Surface from Trace Result to Context
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadOnly)
|
|
|
|
bool bConvertPhysicalSurfaceToContext = true;
|
|
|
|
|
|
|
|
// Default Contexts
|
|
|
|
UPROPERTY(EditAnywhere)
|
|
|
|
FGameplayTagContainer DefaultEffectContexts;
|
|
|
|
|
|
|
|
// Default Libraries for this Actor
|
|
|
|
UPROPERTY(EditAnywhere)
|
|
|
|
TSet<TSoftObjectPtr<ULyraContextEffectsLibrary>> DefaultContextEffectsLibraries;
|
|
|
|
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
|
|
void UpdateEffectContexts(FGameplayTagContainer NewEffectContexts);
|
|
|
|
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
|
|
void UpdateLibraries(TSet<TSoftObjectPtr<ULyraContextEffectsLibrary>> NewContextEffectsLibraries);
|
|
|
|
|
|
|
|
private:
|
|
|
|
UPROPERTY(Transient)
|
|
|
|
FGameplayTagContainer CurrentContexts;
|
|
|
|
|
|
|
|
UPROPERTY(Transient)
|
|
|
|
TSet<TSoftObjectPtr<ULyraContextEffectsLibrary>> CurrentContextEffectsLibraries;
|
|
|
|
|
|
|
|
UPROPERTY(Transient)
|
2022-09-13 07:18:28 +00:00
|
|
|
TArray<TObjectPtr<UAudioComponent>> ActiveAudioComponents;
|
2022-05-23 18:41:30 +00:00
|
|
|
|
|
|
|
UPROPERTY(Transient)
|
2022-09-13 07:18:28 +00:00
|
|
|
TArray<TObjectPtr<UNiagaraComponent>> ActiveNiagaraComponents;
|
2022-05-23 18:41:30 +00:00
|
|
|
};
|