-
Notifications
You must be signed in to change notification settings - Fork 0
/
SInteractionComponent.h
56 lines (35 loc) · 1.33 KB
/
SInteractionComponent.h
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
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "SInteractionComponent.generated.h"
class USWorldUserWidget;
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class ACTIONROGUELIKE_API USInteractionComponent : public UActorComponent
{
GENERATED_BODY()
public:
void PrimaryInteract();
protected:
// Reliable - Will always arrive, eventually. Request will be re-sent unless an acknowledgment was received.
// Unreliable - Not guaranteed, packet can get lost and won't retry.
UFUNCTION(Server, Reliable)
void ServerInteract(AActor* InFocus);
void FindBestInteractable();
virtual void BeginPlay() override;
UPROPERTY()
AActor* FocusedActor;
UPROPERTY(EditDefaultsOnly, Category = "Trace")
float TraceDistance;
UPROPERTY(EditDefaultsOnly, Category = "Trace")
float TraceRadius;
UPROPERTY(EditDefaultsOnly, Category = "Trace")
TEnumAsByte<ECollisionChannel> CollisionChannel;
UPROPERTY(EditDefaultsOnly, Category = "UI")
TSubclassOf<USWorldUserWidget> DefaultWidgetClass;
UPROPERTY()
USWorldUserWidget* DefaultWidgetInstance;
public:
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
USInteractionComponent();
};