KLingo Project Documentation 1.0.0
Unreal Engine 5.6 C++ Project Documentation
로딩중...
검색중...
일치하는것 없음
AConveyorButton 클래스 참조

#include <ConveyorButton.h>

+ AConveyorButton에 대한 상속 다이어그램 :
+ AConveyorButton에 대한 협력 다이어그램:

Public 멤버 함수

 AConveyorButton ()
 
bool GetIsButtonOn ()
 
void InitConveyorButton (const FResponseReadResult &result)
 
virtual void Tick (float DeltaTime) override
 

Protected 멤버 함수

virtual void BeginPlay () override
 
virtual void GetLifetimeReplicatedProps (TArray< class FLifetimeProperty > &OutLifetimeProps) const override
 
void OnInteractionTriggered (AActor *Interactor)
 
void OnOutlineStateChanged (bool bShouldShowOutline)
 

Protected 속성

bool bIsButtonOn = false
 
TObjectPtr< class UBoxComponent > BoxComp
 
TObjectPtr< class USkeletalMeshComponent > ButtonMeshComp
 
TArray< class AActor * > ConveyorBeltActors
 
TObjectPtr< class UInteractableComponent > InteractableComp
 
TObjectPtr< class USceneComponent > RootSceneComp
 
TObjectPtr< class UWidgetComponent > WidgetComp
 

상세한 설명

ConveyorButton.h 파일의 11 번째 라인에서 정의되었습니다.

생성자 & 소멸자 문서화

◆ AConveyorButton()

AConveyorButton::AConveyorButton ( )

ConveyorButton.cpp 파일의 19 번째 라인에서 정의되었습니다.

20{
21 // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
22 PrimaryActorTick.bCanEverTick = true;
23
24 RootSceneComp = CreateDefaultSubobject<USceneComponent>("RootSceneComp");
25 SetRootComponent(RootSceneComp);
26
27 ButtonMeshComp = CreateDefaultSubobject<USkeletalMeshComponent>("ButtonMeshComp");
28 ButtonMeshComp->SetupAttachment(GetRootComponent());
29 ConstructorHelpers::FObjectFinder<USkeletalMesh> buttonMeshRef(TEXT("/Script/Engine.SkeletalMesh'/Game/CustomContents/Platfrom/Assets/ConveyorBelt_Button/button.button'"));
30 if (buttonMeshRef.Succeeded())
31 {
32 ButtonMeshComp->SetSkeletalMesh(buttonMeshRef.Object);
33 ButtonMeshComp->SetRelativeScale3D(FVector(0.4f));
34 }
35
36 InteractableComp = CreateDefaultSubobject<UInteractableComponent>(TEXT("InteractableComp"));
37 InteractableComp->InteractionType = EInteractionType::Button;
38 InteractableComp->InteractionPrompt = TEXT("Activate");
39
40 WidgetComp = CreateDefaultSubobject<UWidgetComponent>(TEXT("WidgetComp"));
41 ConstructorHelpers::FClassFinder<UInteractWidget> WidgetRef(INTERACT_WIDGET_PATH);
42 if (WidgetRef.Succeeded())
43 {
44 WidgetComp->SetWidgetClass(WidgetRef.Class);
45 WidgetComp->SetupAttachment(GetRootComponent());
46 WidgetComp->SetWidgetSpace(EWidgetSpace::Screen);
47 WidgetComp->SetDrawSize(FVector2D(2048.0f, 1024.0f));
48 }
49
50 BoxComp = CreateDefaultSubobject<UBoxComponent>(TEXT("BoxComp"));
51 BoxComp->SetupAttachment(GetRootComponent());
52 BoxComp->SetRelativeLocation(FVector(0.0f, 0.0f, 45.f));
53 BoxComp->SetBoxExtent(FVector(32, 32, 45));
54 BoxComp->SetCollisionEnabled(ECollisionEnabled::Type::QueryOnly);
55 BoxComp->SetCollisionObjectType(ECC_WorldStatic);
56 BoxComp->SetCollisionResponseToAllChannels(ECR_Block);
57
58 bReplicates = true;
59}
#define INTERACT_WIDGET_PATH
TObjectPtr< class USkeletalMeshComponent > ButtonMeshComp
TObjectPtr< class USceneComponent > RootSceneComp
TObjectPtr< class UWidgetComponent > WidgetComp
TObjectPtr< class UBoxComponent > BoxComp
TObjectPtr< class UInteractableComponent > InteractableComp

다음을 참조함 : BoxComp, ButtonMeshComp, INTERACT_WIDGET_PATH, InteractableComp, RootSceneComp, WidgetComp.

멤버 함수 문서화

◆ BeginPlay()

void AConveyorButton::BeginPlay ( )
overrideprotectedvirtual

ConveyorButton.cpp 파일의 62 번째 라인에서 정의되었습니다.

63{
64 Super::BeginPlay();
65
66 // Find Conveyor Belt Actors
67 UGameplayStatics::GetAllActorsOfClass(GetWorld(), AConveyorBelt::StaticClass(), ConveyorBeltActors);
68
69 // Bind Delegate
70 InteractableComp->InitWidget(WidgetComp);
71 InteractableComp->OnInteractionTriggered.AddDynamic(this, &AConveyorButton::OnInteractionTriggered);
72 InteractableComp->OnOutlineStateChanged.AddDynamic(this, &AConveyorButton::OnOutlineStateChanged);
73
74 ALingoGameState* GameState = Cast<ALingoGameState>(GetWorld()->GetGameState());
75 GameState->OnReadResultUpdated.AddDynamic(this, &AConveyorButton::InitConveyorButton);
76}
void OnOutlineStateChanged(bool bShouldShowOutline)
TArray< class AActor * > ConveyorBeltActors
void InitConveyorButton(const FResponseReadResult &result)
void OnInteractionTriggered(AActor *Interactor)
FOnReadResultUpdated OnReadResultUpdated

다음을 참조함 : ConveyorBeltActors, InitConveyorButton(), InteractableComp, OnInteractionTriggered(), OnOutlineStateChanged(), ALingoGameState::OnReadResultUpdated, WidgetComp.

+ 이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ GetIsButtonOn()

bool AConveyorButton::GetIsButtonOn ( )

ConveyorButton.cpp 파일의 105 번째 라인에서 정의되었습니다.

106{
107 return bIsButtonOn;
108}

다음을 참조함 : bIsButtonOn.

◆ GetLifetimeReplicatedProps()

void AConveyorButton::GetLifetimeReplicatedProps ( TArray< class FLifetimeProperty > &  OutLifetimeProps) const
overrideprotectedvirtual

ConveyorButton.cpp 파일의 78 번째 라인에서 정의되었습니다.

79{
80 Super::GetLifetimeReplicatedProps(OutLifetimeProps);
81
82 DOREPLIFETIME(AConveyorButton, ConveyorBeltActors);
83 DOREPLIFETIME(AConveyorButton, bIsButtonOn);
84}

다음을 참조함 : bIsButtonOn, ConveyorBeltActors.

◆ InitConveyorButton()

void AConveyorButton::InitConveyorButton ( const FResponseReadResult result)

ConveyorButton.cpp 파일의 92 번째 라인에서 정의되었습니다.

93{
94 if (bIsButtonOn)
95 {
96 bIsButtonOn = false;
97 for (const auto& Belt : ConveyorBeltActors)
98 {
99 AConveyorBelt* ConveyorBeltActor = Cast<AConveyorBelt>(Belt);
100 ConveyorBeltActor->InitConveyorBelt();
101 }
102 }
103}
void InitConveyorBelt()

다음을 참조함 : bIsButtonOn, ConveyorBeltActors, AConveyorBelt::InitConveyorBelt().

다음에 의해서 참조됨 : BeginPlay().

+ 이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
+ 이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ OnInteractionTriggered()

void AConveyorButton::OnInteractionTriggered ( AActor *  Interactor)
protected

ConveyorButton.cpp 파일의 110 번째 라인에서 정의되었습니다.

111{
112 if (ConveyorBeltActors.IsEmpty()) return;
113
115 // PRINT_STRING(TEXT("%d"), bIsButtonOn);
116 for (const auto& Belt : ConveyorBeltActors)
117 {
118 AConveyorBelt* ConveyorBeltActor = Cast<AConveyorBelt>(Belt);
119 ConveyorBeltActor->ChangeConveyorMovement();
120 }
121}
void ChangeConveyorMovement()

다음을 참조함 : bIsButtonOn, AConveyorBelt::ChangeConveyorMovement(), ConveyorBeltActors.

다음에 의해서 참조됨 : BeginPlay().

+ 이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:
+ 이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ OnOutlineStateChanged()

void AConveyorButton::OnOutlineStateChanged ( bool  bShouldShowOutline)
protected

ConveyorButton.cpp 파일의 123 번째 라인에서 정의되었습니다.

124{
125 if (ButtonMeshComp)
126 {
127 ButtonMeshComp->SetRenderCustomDepth(bShouldShowOutline);
128 }
129}

다음을 참조함 : ButtonMeshComp.

다음에 의해서 참조됨 : BeginPlay().

+ 이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ Tick()

void AConveyorButton::Tick ( float  DeltaTime)
overridevirtual

ConveyorButton.cpp 파일의 87 번째 라인에서 정의되었습니다.

88{
89 Super::Tick(DeltaTime);
90}

멤버 데이터 문서화

◆ bIsButtonOn

bool AConveyorButton::bIsButtonOn = false
protected

ConveyorButton.h 파일의 60 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : GetIsButtonOn(), GetLifetimeReplicatedProps(), InitConveyorButton(), OnInteractionTriggered().

◆ BoxComp

TObjectPtr<class UBoxComponent> AConveyorButton::BoxComp
protected

ConveyorButton.h 파일의 46 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : AConveyorButton().

◆ ButtonMeshComp

TObjectPtr<class USkeletalMeshComponent> AConveyorButton::ButtonMeshComp
protected

ConveyorButton.h 파일의 37 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : AConveyorButton(), OnOutlineStateChanged().

◆ ConveyorBeltActors

TArray<class AActor*> AConveyorButton::ConveyorBeltActors
protected

ConveyorButton.h 파일의 50 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : BeginPlay(), GetLifetimeReplicatedProps(), InitConveyorButton(), OnInteractionTriggered().

◆ InteractableComp

TObjectPtr<class UInteractableComponent> AConveyorButton::InteractableComp
protected

ConveyorButton.h 파일의 40 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : AConveyorButton(), BeginPlay().

◆ RootSceneComp

TObjectPtr<class USceneComponent> AConveyorButton::RootSceneComp
protected

ConveyorButton.h 파일의 34 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : AConveyorButton().

◆ WidgetComp

TObjectPtr<class UWidgetComponent> AConveyorButton::WidgetComp
protected

ConveyorButton.h 파일의 43 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : AConveyorButton(), BeginPlay().


이 클래스에 대한 문서화 페이지는 다음의 파일들로부터 생성되었습니다.: