Download LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGameplayEffectContext.h from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 2.41 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGameplayEffectContext.h
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGameplayEffectContext.h
-
curl -L -o LyraGameplayEffectContext.h https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/AbilitySystem/LyraGameplayEffectContext.h
2.41 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| class AActor; | |
| class FArchive; | |
| class ILyraAbilitySourceInterface; | |
| class UObject; | |
| class UPhysicalMaterial; | |
| USTRUCT() | |
| struct FLyraGameplayEffectContext : public FGameplayEffectContext | |
| { | |
| GENERATED_BODY() | |
| FLyraGameplayEffectContext() | |
| : FGameplayEffectContext() | |
| { | |
| } | |
| FLyraGameplayEffectContext(AActor* InInstigator, AActor* InEffectCauser) | |
| : FGameplayEffectContext(InInstigator, InEffectCauser) | |
| { | |
| } | |
| /** Returns the wrapped FLyraGameplayEffectContext from the handle, or nullptr if it doesn't exist or is the wrong type */ | |
| static LYRAGAME_API FLyraGameplayEffectContext* ExtractEffectContext(struct FGameplayEffectContextHandle Handle); | |
| /** Sets the object used as the ability source */ | |
| void SetAbilitySource(const ILyraAbilitySourceInterface* InObject, float InSourceLevel); | |
| /** Returns the ability source interface associated with the source object. Only valid on the authority. */ | |
| const ILyraAbilitySourceInterface* GetAbilitySource() const; | |
| virtual FGameplayEffectContext* Duplicate() const override | |
| { | |
| FLyraGameplayEffectContext* NewContext = new FLyraGameplayEffectContext(); | |
| *NewContext = *this; | |
| if (GetHitResult()) | |
| { | |
| // Does a deep copy of the hit result | |
| NewContext->AddHitResult(*GetHitResult(), true); | |
| } | |
| return NewContext; | |
| } | |
| virtual UScriptStruct* GetScriptStruct() const override | |
| { | |
| return FLyraGameplayEffectContext::StaticStruct(); | |
| } | |
| /** Overridden to serialize new fields */ | |
| virtual bool NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess) override; | |
| /** Returns the physical material from the hit result if there is one */ | |
| const UPhysicalMaterial* GetPhysicalMaterial() const; | |
| public: | |
| /** ID to allow the identification of multiple bullets that were part of the same cartridge */ | |
| UPROPERTY() | |
| int32 CartridgeID = -1; | |
| protected: | |
| /** Ability Source object (should implement ILyraAbilitySourceInterface). NOT replicated currently */ | |
| UPROPERTY() | |
| TWeakObjectPtr<const UObject> AbilitySourceObject; | |
| }; | |
| template<> | |
| struct TStructOpsTypeTraits<FLyraGameplayEffectContext> : public TStructOpsTypeTraitsBase2<FLyraGameplayEffectContext> | |
| { | |
| enum | |
| { | |
| WithNetSerializer = true, | |
| WithCopy = true | |
| }; | |
| }; | |