File size: 2,360 Bytes
7fd553e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | // Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "GameplayTagContainer.h"
#include "UObject/SoftObjectPath.h"
#include "UObject/WeakObjectPtr.h"
#include "LyraContextEffectsLibrary.generated.h"
#define UE_API LYRAGAME_API
class UNiagaraSystem;
class USoundBase;
struct FFrame;
/**
*
*/
UENUM()
enum class EContextEffectsLibraryLoadState : uint8 {
Unloaded = 0,
Loading = 1,
Loaded = 2
};
/**
*
*/
USTRUCT(BlueprintType)
struct FLyraContextEffects
{
GENERATED_BODY()
UPROPERTY(EditAnywhere, BlueprintReadOnly)
FGameplayTag EffectTag;
UPROPERTY(EditAnywhere, BlueprintReadOnly)
FGameplayTagContainer Context;
UPROPERTY(EditAnywhere, BlueprintReadOnly, meta = (AllowedClasses = "/Script/Engine.SoundBase, /Script/Niagara.NiagaraSystem"))
TArray<FSoftObjectPath> Effects;
};
/**
*
*/
UCLASS(MinimalAPI)
class ULyraActiveContextEffects : public UObject
{
GENERATED_BODY()
public:
UPROPERTY(VisibleAnywhere)
FGameplayTag EffectTag;
UPROPERTY(VisibleAnywhere)
FGameplayTagContainer Context;
UPROPERTY(VisibleAnywhere)
TArray<TObjectPtr<USoundBase>> Sounds;
UPROPERTY(VisibleAnywhere)
TArray<TObjectPtr<UNiagaraSystem>> NiagaraSystems;
};
DECLARE_DYNAMIC_DELEGATE_OneParam(FLyraContextEffectLibraryLoadingComplete, TArray<ULyraActiveContextEffects*>, LyraActiveContextEffects);
/**
*
*/
UCLASS(MinimalAPI, BlueprintType)
class ULyraContextEffectsLibrary : public UObject
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadOnly)
TArray<FLyraContextEffects> ContextEffects;
UFUNCTION(BlueprintCallable)
UE_API void GetEffects(const FGameplayTag Effect, const FGameplayTagContainer Context, TArray<USoundBase*>& Sounds, TArray<UNiagaraSystem*>& NiagaraSystems);
UFUNCTION(BlueprintCallable)
UE_API void LoadEffects();
UE_API EContextEffectsLibraryLoadState GetContextEffectsLibraryLoadState();
private:
void LoadEffectsInternal();
void LyraContextEffectLibraryLoadingComplete(TArray<ULyraActiveContextEffects*> LyraActiveContextEffects);
UPROPERTY(Transient)
TArray< TObjectPtr<ULyraActiveContextEffects>> ActiveContextEffects;
UPROPERTY(Transient)
EContextEffectsLibraryLoadState EffectsLoadState = EContextEffectsLibraryLoadState::Unloaded;
};
#undef UE_API
|