Download LyraStarterGame/Source/LyraGame/Interaction/InteractionOption.h from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 2.67 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/Interaction/InteractionOption.h
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Source/LyraGame/Interaction/InteractionOption.h
-
curl -L -o InteractionOption.h https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/Interaction/InteractionOption.h
2.67 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| class IInteractableTarget; | |
| class UUserWidget; | |
| /** */ | |
| USTRUCT(BlueprintType) | |
| struct FInteractionOption | |
| { | |
| GENERATED_BODY() | |
| public: | |
| /** The interactable target */ | |
| UPROPERTY(BlueprintReadWrite) | |
| TScriptInterface<IInteractableTarget> InteractableTarget; | |
| /** Simple text the interaction might return */ | |
| UPROPERTY(EditAnywhere, BlueprintReadWrite) | |
| FText Text; | |
| /** Simple sub-text the interaction might return */ | |
| UPROPERTY(EditAnywhere, BlueprintReadWrite) | |
| FText SubText; | |
| // METHODS OF INTERACTION | |
| //-------------------------------------------------------------- | |
| // 1) Place an ability on the avatar that they can activate when they perform interaction. | |
| /** The ability to grant the avatar when they get near interactable objects. */ | |
| UPROPERTY(EditAnywhere, BlueprintReadOnly) | |
| TSubclassOf<UGameplayAbility> InteractionAbilityToGrant; | |
| // - OR - | |
| // 2) Allow the object we're interacting with to have its own ability system and interaction ability, that we can activate instead. | |
| /** The ability system on the target that can be used for the TargetInteractionHandle and sending the event, if needed. */ | |
| UPROPERTY(BlueprintReadOnly) | |
| TObjectPtr<UAbilitySystemComponent> TargetAbilitySystem = nullptr; | |
| /** The ability spec to activate on the object for this option. */ | |
| UPROPERTY(BlueprintReadOnly) | |
| FGameplayAbilitySpecHandle TargetInteractionAbilityHandle; | |
| // UI | |
| //-------------------------------------------------------------- | |
| /** The widget to show for this kind of interaction. */ | |
| UPROPERTY(EditAnywhere, BlueprintReadWrite) | |
| TSoftClassPtr<UUserWidget> InteractionWidgetClass; | |
| //-------------------------------------------------------------- | |
| public: | |
| FORCEINLINE bool operator==(const FInteractionOption& Other) const | |
| { | |
| return InteractableTarget == Other.InteractableTarget && | |
| InteractionAbilityToGrant == Other.InteractionAbilityToGrant&& | |
| TargetAbilitySystem == Other.TargetAbilitySystem && | |
| TargetInteractionAbilityHandle == Other.TargetInteractionAbilityHandle && | |
| InteractionWidgetClass == Other.InteractionWidgetClass && | |
| Text.IdenticalTo(Other.Text) && | |
| SubText.IdenticalTo(Other.SubText); | |
| } | |
| FORCEINLINE bool operator!=(const FInteractionOption& Other) const | |
| { | |
| return !operator==(Other); | |
| } | |
| FORCEINLINE bool operator<(const FInteractionOption& Other) const | |
| { | |
| return InteractableTarget.GetInterface() < Other.InteractableTarget.GetInterface(); | |
| } | |
| }; | |