Payback 0.0.1
CK Graduation Project
로딩중...
검색중...
일치하는것 없음
InteractabilityComponent.h
이 파일의 문서화 페이지로 가기
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#include "Components/ActorComponent.h"
6#include "Data/UI/UIContext.h"
7#include "InteractabilityComponent.generated.h"
8
9struct FUIContext;
11
12
13UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
14class CK_UE_API UInteractabilityComponent : public UActorComponent
15{
16 GENERATED_BODY()
17
18public:
20
21public:
22 void RegisterToChannel(UInteractionChannel* Channel);
23 void UnregisterFromChannel();
24
25public:
27 FORCEINLINE bool ShouldShowInteractionMessage() const
28 {
29 return bShowInteractionMessage;
30 }
31
32
34 FORCEINLINE const FText& GetInteractionMessage() const
35 {
36 return InteractionMessage;
37 }
38
39
40 FORCEINLINE bool IsChannelRegistered() const
41 {
42 return ActiveChannel != nullptr;
43 }
44
45
47 {
48 return ActiveChannel.Get();
49 }
50
51protected:
52 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Interactability")
53 bool bCanInteractByDefault = true;
54
56 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Interactability|Message")
57 bool bShowInteractionMessage = false;
58
60 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Interactability|Message", meta = (EditCondition = "bShowInteractionMessage", MultiLine = "true"))
61 FText InteractionMessage = NSLOCTEXT("InteractabilityComponent", "DefaultInteractionMessage", "키를 눌러 상호작용하기");
62
63private:
64 UPROPERTY(Transient)
65 TObjectPtr<UInteractionChannel> ActiveChannel;
66};
Definition InteractabilityComponent.h:15
FORCEINLINE UInteractionChannel * GetActiveChannel() const
Definition InteractabilityComponent.h:46
FORCEINLINE bool ShouldShowInteractionMessage() const
Definition InteractabilityComponent.h:27
FORCEINLINE bool IsChannelRegistered() const
Definition InteractabilityComponent.h:40
FORCEINLINE const FText & GetInteractionMessage() const
Definition InteractabilityComponent.h:34
Definition InteractionChannel.h:21
Definition UIContext.h:10