Payback 0.0.1
CK Graduation Project
로딩중...
검색중...
일치하는것 없음
EventGate.h
이 파일의 문서화 페이지로 가기
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Engine/TriggerBox.h"
7#include "GameFramework/Actor.h"
10#include "EventGate.generated.h"
11
13class UBoxComponent;
14class UStageEventListenerComponent;
15class UStageEventSenderComponent;
16
17
18UENUM(Blueprintable, BlueprintType)
19enum class EGateDetectionTiming : uint8
20{
21 // 플레이어가 게이트 영역에 진입하는 순간 이벤트 발화.
22 OnBeginOverlap UMETA(DisplayName = "On Begin Overlap"),
23
24 // 플레이어가 게이트 영역에서 이탈하는 순간 이벤트 발화.
25 OnEndOverlap UMETA(DisplayName = "On End Overlap")
26};
27
28
29UCLASS(Blueprintable)
31{
32 GENERATED_BODY()
33
34public:
35 AEventGate();
36
37public:
38 UFUNCTION(BlueprintPure, Category = "EventGate")
39 FName GetId() const;
40
41 UFUNCTION(BlueprintPure, Category = "EventGate")
42 virtual UStageEventListenerComponent* GetEventListenerComponent() const override
43 {
44 return EventListenerComponent;
45 }
46
47 UFUNCTION(BlueprintPure, Category = "EventGate")
48 virtual EStageEvent GetStageEvent() const override
49 {
51 }
52
53protected:
54 virtual void BeginPlay() override;
55 virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
56 virtual void OnBeginInteraction(const AActor* Caller) override;
57 virtual void OnEndInteraction(const AActor* Caller) override;
58
59protected:
60 UFUNCTION()
61 void HandleBoxBeginOverlap(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);
62
63 UFUNCTION()
64 void HandleBoxEndOverlap(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex);
65
66 UFUNCTION(BlueprintImplementableEvent, Category = "EventGate")
67 void OnBeginInteraction_Internal(const AActor* Caller);
68
69 UFUNCTION(BlueprintImplementableEvent, Category = "EventGate")
70 void OnEndInteraction_Internal(const AActor* Caller);
71
72 UFUNCTION(BlueprintImplementableEvent, Category = "EventGate")
73 void OnGateOverlapEnter(AActor* OtherActor, UPrimitiveComponent* OtherComp);
74
75 UFUNCTION(BlueprintImplementableEvent, Category = "EventGate")
76 void OnGateOverlapExit(AActor* OtherActor, UPrimitiveComponent* OtherComp);
77
78private:
79 void TryFireGateEvent(AActor* OtherActor);
80
81protected:
82 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "EventGate")
83 bool bIgnoreOverlap = false;
84
85 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "EventGate")
86 EGateDetectionTiming DetectionTiming = EGateDetectionTiming::OnBeginOverlap;
87
88 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "EventGate")
89 TObjectPtr<UStageEventListenerComponent> EventListenerComponent;
90
91 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "EventGate")
92 TObjectPtr<UStageEventSenderComponent> GateEventSender;
93
94 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "EventGate")
95 TObjectPtr<UBoxComponent> BoxComponent;
96
97private:
98 UPROPERTY()
99 FName StageEventID_DEPRECATED = NAME_None;
100};
EStageEvent
Definition EStageEventEnums.h:5
EGateDetectionTiming
Definition EventGate.h:20
Definition EventGate.h:31
Definition InteractableActor.h:16
Definition StageEventListenerInterface.h:24
Definition StoryboardDefinition.h:37