5#include "CoreMinimal.h"
9#include "InteractableActorComponent.generated.h"
27 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=
"Interact")
28 AActor* Actor =
nullptr;
30 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="
Interact")
31 bool bOverlapping = false;
32 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="
Interact")
33 bool bFocused = false;
34 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="
Interact")
35 bool bInteracting = false;
46 return Actor ==
Other.Actor;
50 return Actor ==
Other;
54 return Actor !=
nullptr;
59UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent))
60class INTERACTION_API UInteractableActorComponent :
public UCommonActorComponent,
public IInteractionInterface
65 UInteractableActorComponent();
67 virtual
void TickComponent(
float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
69 virtual FVector GetInteractionLocation() const override;
70 virtual UPrimitiveComponent* GetGrabComponent() const override;
72 virtual
void StartFocus(AActor* Caller) override;
73 virtual
void EndFocus(AActor* Caller) override;
74 virtual
void OnInteract(AActor* Caller, const int32 SelectedInteraction = 0) override;
75 virtual
void OnEndInteract(AActor* Caller) override;
77 virtual
bool OnOverlap(AActor* Caller) override;
78 virtual
void OnEndOverlap(AActor* Caller) override;
80 virtual
void ToggleSwitch(AActor* Caller, const
bool bOn) override;
82 virtual
void InteractionDataUpdated() const override;
83 virtual
void UpdateInteractionData() override;
86 virtual
float GetAimAssistInfluence()
const override{
return AimAssistInfluence;};
88 UFUNCTION(BlueprintCallable, Category =
"Interaction")
95 virtual
FInteractionData& GetInteractionData()
override {
return InteractionData;};
98 UPROPERTY(BlueprintAssignable, Category =
"Interaction")
99 FOnStartFocus OnStartFocusDelegate;
100 UPROPERTY(BlueprintAssignable, Category = "
Interaction")
101 FOnEndFocus OnEndFocusDelegate;
102 UPROPERTY(BlueprintAssignable, Category = "
Interaction")
103 FOnInteract OnInteractDelegate;
104 UPROPERTY(BlueprintAssignable, Category = "
Interaction")
105 FOnEndInteract OnEndInteractDelegate;
106 UPROPERTY(BlueprintAssignable, Category = "
Interaction")
107 FOnOverlap OnOverlapDelegate;
108 UPROPERTY(BlueprintAssignable, Category = "
Interaction")
109 FOnEndOverlap OnEndOverlapDelegate;
110 UPROPERTY(BlueprintAssignable, Category = "
Interaction")
111 FOnToggleSwitch OnToggleSwitchDelegate;
112 UPROPERTY(BlueprintAssignable, Category = "
Interaction")
113 FInteractionDataUpdated OnInteractionDataUpdated;
116 bool bPickupOnOverlap = false;
118 float AimAssistInfluence = 0.5f;
120 bool bLoseFocusAfterInteract = false;
122 bool bOutlineMeshOnFocus = true;
123 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="
Interaction|
General", meta=(EditCondition=bOutlineMeshOnFocus))
124 int32 OutlineFocusValue = 1;
126 bool bAlwaysShowOutline = false;
127 UPROPERTY(ReplicatedUsing=OnRep_InteractionData, EditAnywhere, BlueprintReadWrite, Category="
Interaction")
131 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Interaction|Display")
135 virtual
void BeginPlay() override;
137 virtual
bool SaveGame() override;
138 virtual
bool LoadGame() override;
141 void OnRep_InteractionData();
143 void ShowMeshOutline(const
bool bOn) const;
147 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category="Debugging")
148 bool bShowInteractLogs = false;
152 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category="
Interaction")
156 bool bActorOverlapped = false;
EInteractionType
Definition BaseData.h:149
EAIStimuliType
Definition BaseData.h:198
UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent)) class CHATSYSTEM_API UChatSystemComponent
Definition ChatSystemComponent.h:13
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FInteractionDataUpdated)
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnInteract, AActor *, Caller, const EInteractionType, InteractionType)
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnEndInteract, AActor *, Caller)
Definition InteractionInterface.h:18
Definition Interaction.Build.cs:6
Definition BaseData.h:310
Definition InteractableActorComponent.h:24
FInteractionActor(AActor *InActor)
Definition InteractableActorComponent.h:39
bool operator==(const FInteractionActor &Other) const
Definition InteractableActorComponent.h:44
bool operator==(const AActor *Other) const
Definition InteractableActorComponent.h:48
bool IsValid() const
Definition InteractableActorComponent.h:52
Definition BaseData.h:420