KLingo Project Documentation 1.0.0
Unreal Engine 5.6 C++ Project Documentation
로딩중...
검색중...
일치하는것 없음
TutorialComponent.h
이 파일의 문서화 페이지로 가기
1// Copyright (c) 2025 Doppleddiggong. All rights reserved. Unauthorized copying, modification, or distribution of this file, via any medium is strictly prohibited. Proprietary and confidential.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Components/ActorComponent.h"
7#include "ETutorialStep.h"
8#include "TutorialComponent.generated.h"
9
10
11UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
12class ONEPIECE_API UTutorialComponent : public UActorComponent
13{
14 GENERATED_BODY()
15
16public:
17 // Sets default values for this component's properties
18 UTutorialComponent();
19
20protected:
21 // Called when the game starts
22 virtual void BeginPlay() override;
23
24public:
25 // Called every frame
26 virtual void TickComponent(float DeltaTime, ELevelTick TickType,
27 FActorComponentTickFunction* ThisTickFunction) override;
28
29public:
30 // 현재 튜토리얼 단계
31 UPROPERTY(BlueprintReadOnly, Category = "Tutorial")
32 ETutorialStep CurrentStep;
33
34 UFUNCTION(BlueprintCallable, Category = "Tutorial")
35 void StartTutorial();
36
37 UFUNCTION(BlueprintCallable, Category = "Tutorial")
38 void AdvanceToNextStep();
39 // 특정 단계로 이동
40 UFUNCTION(BlueprintCallable, Category = "Tutorial")
41 void SetStep(ETutorialStep NewStep);
42 // 튜토리얼 완료됐는지 확인
43 UFUNCTION(BlueprintCallable, Category = "Tutorial")
44 bool IsTutorialCompleted() const;
45
46private:
47 // 현 단계의 입력 조건 확인
48 void CheckInputConditions();
49 void OnInputConditionMet();
50
51 bool bInputConditionMet = false;
52 // 입력 후 다음 단계 전 딜레이
53 FTimerHandle AdvanceDelayTimerHandle;
54
55 // 다음 단계 반환
56 ETutorialStep GetNextStep(ETutorialStep Step) const;
57
59 bool CheckMouseLookInput() const;
60 bool CheckMovementInput() const;
61 bool CheckSprintInput() const;
62 bool CheckJumpInput() const;
63 bool CheckPickUpInput() const;
64 bool CheckGrabGunInput() const;
65 bool CheckInteractionInput() const;
66
67 // 단계별 메세지 반환
68 FText GetTutorialMessage(ETutorialStep Step) const;
69
70 // 소유 PlayerController 캐시
71 APlayerController* OwnerController;
72
73 // 이전 프레임의 카메라 회전값
74 FRotator LastControlRotation;
75
76public:
77 // Tutorial Quests
78 // Luggage 그랩건 시 호출
79 void OnObjectGrabbed(AActor* GrabbedObject);
80 // Luggage 픽업 시 호출
81 void OnObjectPickedUp(AActor* PickedObject);
82 // E키로 스위치 상호작용 시 호출
83 void OnObjectInteracted(AActor* InteractedObject);
84
85private:
86 // Conditions
87 bool bGrabbedLuggage = false;
88 bool bPickedUpSomething = false;
89 bool bInteractedWithSwitch = false;
90};
ETutorialStep
튜토리얼 진행 단계