Payback 0.0.1
CK Graduation Project
로딩중...
검색중...
일치하는것 없음
CheckPoint.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 "GameFramework/Actor.h"
9#include "CheckPoint.generated.h"
10
13class UBoxComponent;
14class USceneComponent;
15class ACheckPoint;
16
17#if WITH_EDITORONLY_DATA
18class UBillboardComponent;
19#endif
20
21DECLARE_DYNAMIC_MULTICAST_DELEGATE_FourParams(FOnCheckPointSavedDelegate, AActor*, ContactActor, float, SavedTimeSeconds, FVector, SavedLocation, ACheckPoint*, CheckPoint);
22
23UCLASS()
25{
26 GENERATED_BODY()
27
28public:
30
31public:
33 {
34 return EventListenerComponent;
35 }
36
37
38public:
39 UFUNCTION(BlueprintCallable, Category = "CheckPoint")
40 void SaveCheckPoint(AActor* PlayerActor);
41
42 UFUNCTION(BlueprintCallable, Category = "CheckPoint")
43 void SendRespawnEvent(AActor* PlayerActor);
44
45public:
46 UFUNCTION(BlueprintPure, Category = "CheckPoint")
47 FORCEINLINE FTransform GetSpawnTransform() const
48 {
49 return SpawnPointComponent ? SpawnPointComponent->GetComponentTransform() : GetActorTransform();
50 }
51
52public:
53 UPROPERTY(BlueprintAssignable, Category = "CheckPoint")
54 FOnCheckPointSavedDelegate OnCheckPointSaved;
55
56protected:
57 virtual void BeginPlay() override;
58 virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
59
60protected:
61 UFUNCTION()
62 void HandleBoxBeginOverlap(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);
63
64private:
65 void ActivateOnBeginPlay();
66
67protected:
68 // 레벨 시작 시 자동으로 체크포인트를 저장합니다.
69 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "CheckPoint")
70 bool bActivateOnBeginPlay = false;
71
72 // true이면 최초 감지 이후 모든 진입을 무시합니다.
73 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "CheckPoint")
74 bool bDetectOnce = true;
75
76 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CheckPoint")
77 TObjectPtr<UBoxComponent> BoxComponent;
78
79 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CheckPoint")
80 TObjectPtr<UStageEventListenerComponent> EventListenerComponent;
81
82 // 플레이어가 이 체크포인트에 도달했을 때 발사.
83 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CheckPoint")
84 TObjectPtr<UStageEventSenderComponent> VisitEventSender;
85
86 // 이 체크포인트에서 플레이어가 부활(리스폰)했을 때 발사.
87 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CheckPoint")
88 TObjectPtr<UStageEventSenderComponent> RespawnEventSender;
89
90 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CheckPoint")
91 TObjectPtr<USceneComponent> SpawnPointComponent;
92
93#if WITH_EDITORONLY_DATA
94 UPROPERTY(VisibleAnywhere)
95 TObjectPtr<UBillboardComponent> SpriteComponent;
96#endif
97
98private:
99 bool bVisited = false;
100};
DECLARE_DYNAMIC_MULTICAST_DELEGATE_FourParams(FOnCheckPointSavedDelegate, AActor *, ContactActor, float, SavedTimeSeconds, FVector, SavedLocation, ACheckPoint *, CheckPoint)
Definition CheckPoint.h:25
virtual UStageEventListenerComponent * GetEventListenerComponent() const
Definition CheckPoint.h:32
Definition InteractableActor.h:16
Definition StageEventBehaviorInterface.h:22
Definition StageEventListenerComponent.h:14
Definition StageEventSenderComponent.h:9