KLingo Project Documentation 1.0.0
Unreal Engine 5.6 C++ Project Documentation
로딩중...
검색중...
일치하는것 없음
FoodHolder.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 "GameFramework/Actor.h"
7#include "FoodHolder.generated.h"
8
9UCLASS()
10class ONEPIECE_API AFoodHolder : public AActor
11{
12 GENERATED_BODY()
13
14public:
16
17protected:
18 virtual void BeginPlay() override;
19 virtual void Tick(float DeltaTime) override;
20 virtual void GetLifetimeReplicatedProps(TArray<class FLifetimeProperty>& OutLifetimeProps) const override;
21
22public:
23 // Events
24 UFUNCTION(BlueprintImplementableEvent, Category = "Holder")
25 void OnActivate(bool bSuccess);
26
31 UFUNCTION(NetMulticast, Reliable)
32 void Multicast_ShowResultPopup(int32 CorrectAnswerIndex);
33
38 UFUNCTION(NetMulticast, Reliable)
39 void Multicast_ShowWrongPopup(const FString& FoodName);
40
45 void SetAnswerFoodIndex(int32 InAnswerFoodIndex);
46
47private:
48 UFUNCTION()
49 void OnRep_IsActivated();
50
51 UFUNCTION()
52 void OnRep_CurTarget();
53
57 UFUNCTION()
58 void OnFoodBoxOverlapBegin(
59 UPrimitiveComponent* OverlappedComponent,
60 AActor* OtherActor,
61 UPrimitiveComponent* OtherComp,
62 int32 OtherBodyIndex,
63 bool bFromSweep,
64 const FHitResult& SweepResult);
65
71 bool CheckFood(class AFood* TargetFood);
72 void CheckPartialAnswer(const struct FFoodCapsuleData& TargetData, bool& bOutCityCorrect, bool& bOutFoodCorrect);
73
74 void UpdateActivateState(bool State);
75
76public:
77 // Components
78 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
79 TObjectPtr<class UBoxComponent> BoxCollision;
80
81 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Components")
82 TObjectPtr<class USkeletalMeshComponent> MeshComponent;
83
84 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Spawning")
85 TObjectPtr<class USceneComponent> HoldPos;
86
87 UPROPERTY(EditAnywhere, BlueprintReadWrite)
88 int32 Index = 0;
89
90protected:
91 // 시도 횟수
92 UPROPERTY(Replicated)
93 int32 TryIdx = -1;
94
95 // 현재 올라가 있는 액터
96 UPROPERTY(ReplicatedUsing=OnRep_CurTarget)
97 TObjectPtr<class AActor> CurTarget;
98
99 // State
100 UPROPERTY(ReplicatedUsing=OnRep_IsActivated, VisibleAnywhere, BlueprintReadOnly, Category = "State")
101 bool bIsActivated = false;
102
103 // Visual Settings
104 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Visual")
105 float ActivatedHeightOffset = 50.0f;
106
107 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Visual")
108 float RotationSpeed = 90.0f;
109
110 // Answer Settings
112 int32 AnswerFoodIndex = -1;
113
114};
Definition Food.h:37