Space Plunder
Loading...
Searching...
No Matches
AInteractableActor Class Reference

#include <InteractableActor.h>

Inheritance diagram for AInteractableActor:
AActorBase IBaseInterface ISaveLoad AInteractableActorWithPrompt AInteractableBox AInteractableSwitch AInteractionPingActor AOpenableDoorActor AWeaponAttachmentPickup AWeaponPickup ATerminal ADestructibleOpenableDoorActor ADoubleDoorActor

Public Member Functions

 AInteractableActor ()
 
virtual void ReceiveStartFocus (AActor *Caller)
 
virtual void ReceiveEndFocus (AActor *Caller)
 
virtual void ReceiveOnInteract (AActor *Caller, const EInteractionType InteractionType)
 
virtual void ReceiveOnEndInteract (AActor *Caller)
 
virtual void ReceiveOnOverlap (AActor *Caller)
 
virtual void ReceiveOnEndOverlap (AActor *Caller)
 
virtual void ReceiveToggleSwitch (AActor *Caller, const bool bOn)
 
- Public Member Functions inherited from AActorBase
 AActorBase ()
 
virtual bool SaveGame () override
 
virtual bool LoadGame () override
 
void SetGravityEnabledEvent (const bool bValue)
 

Protected Member Functions

virtual void BeginPlay () override
 
virtual void Tick (float DeltaTime) override
 
virtual void SetMeshOutline (const bool bValue)
 
- Protected Member Functions inherited from AActorBase
void LogDebugError (const FString &Message) const
 
void LogDebugError (const FString &Message, const int32 Value) const
 
void LogDebugError (const FString &Message, const float Value) const
 
void LogDebugWarning (const FString &Message) const
 
void LogDebugWarning (const FString &Message, const int32 Value) const
 
void LogDebugWarning (const FString &Message, const float Value) const
 
void LogDebugMessage (const FString &Message, const bool bWarning=false, const bool bError=false) const
 
void LogDebugMessage (const FString &Message, const int32 Value, const bool bWarning=false, const bool bError=false) const
 
void LogDebugMessage (const FString &Message, const float Value, const bool bWarning=false, const bool bError=false) const
 
void LogDebugMessage (const FString &Message, const bool bValue, const bool bWarning, const bool bError) const
 
void LogOnScreenMessage (const int32 Key, const FString &Message, FColor Color=FColor::Green) const
 
void SetCategoryName (const FLogCategoryBase &Category)
 

Protected Attributes

class UInteractableActorComponent * InteractableActorComponent
 
class UAudioReactionComponent * AudioReactionComponent
 
class UAIPerceptionStimuliSourceComponent * PerceptionStimuliComponent
 
- Protected Attributes inherited from AActorBase
FString DisplayName = "Display Name"
 
bool bDebuggingMode = false
 

Constructor & Destructor Documentation

◆ AInteractableActor()

AInteractableActor::AInteractableActor ( )
18{
19 PrimaryActorTick.bCanEverTick = true;
20
21 AudioReactionComponent = CreateDefaultSubobject<UAudioReactionComponent>("Audio Reaction");
22
23 InteractableActorComponent = CreateDefaultSubobject<UInteractableActorComponent>(TEXT("Interactable Actor Component"));
24 InteractableActorComponent->OnInteractDelegate.AddUniqueDynamic(this, &AInteractableActor::ReceiveOnInteract);
25 InteractableActorComponent->OnEndInteractDelegate.AddUniqueDynamic(this, &AInteractableActor::ReceiveOnEndInteract);
26 InteractableActorComponent->OnStartFocusDelegate.AddUniqueDynamic(this, &AInteractableActor::ReceiveStartFocus);
27 InteractableActorComponent->OnEndFocusDelegate.AddUniqueDynamic(this, &AInteractableActor::ReceiveEndFocus);
28 InteractableActorComponent->OnToggleSwitchDelegate.AddUniqueDynamic(this, &AInteractableActor::ReceiveToggleSwitch);
29 InteractableActorComponent->OnOverlapDelegate.AddUniqueDynamic(this, &AInteractableActor::ReceiveOnOverlap);
30 InteractableActorComponent->OnEndOverlapDelegate.AddUniqueDynamic(this, &AInteractableActor::ReceiveOnEndOverlap);
31 // InteractableActorComponent->OnInteractionDataUpdated.AddUniqueDynamic(this, &AInteractableActor::InteractionDataUpdated);
32 InteractableActorComponent->bPickupOnOverlap = false;
34
35
36 PerceptionStimuliComponent = CreateDefaultSubobject<UAIPerceptionStimuliSourceComponent>("Perception Stimuli");
37 PerceptionStimuliComponent->RegisterForSense(UAISenseConfig_Sight::StaticClass());
38#if WITH_EDITOR
39 bDebuggingMode = true;
40#endif
41 SetCategoryName(LogInteractableActor);
42}
bool bDebuggingMode
Definition ActorBase.h:53
void SetCategoryName(const FLogCategoryBase &Category)
Definition ActorBase.h:47
virtual void ReceiveToggleSwitch(AActor *Caller, const bool bOn)
Definition InteractableActor.cpp:73
virtual void ReceiveOnEndOverlap(AActor *Caller)
Definition InteractableActor.cpp:69
class UAIPerceptionStimuliSourceComponent * PerceptionStimuliComponent
Definition InteractableActor.h:67
virtual void ReceiveOnOverlap(AActor *Caller)
Definition InteractableActor.cpp:65
class UAudioReactionComponent * AudioReactionComponent
Definition InteractableActor.h:65
virtual void ReceiveOnInteract(AActor *Caller, const EInteractionType InteractionType)
Definition InteractableActor.cpp:52
virtual void ReceiveEndFocus(AActor *Caller)
Definition InteractableActor.cpp:48
class UInteractableActorComponent * InteractableActorComponent
Definition InteractableActor.h:63
virtual void ReceiveOnEndInteract(AActor *Caller)
Definition InteractableActor.cpp:61
virtual void ReceiveStartFocus(AActor *Caller)
Definition InteractableActor.cpp:44
Definition BaseData.h:420

Member Function Documentation

◆ BeginPlay()

void AInteractableActor::BeginPlay ( )
overrideprotectedvirtual

◆ ReceiveEndFocus()

void AInteractableActor::ReceiveEndFocus ( AActor * Caller)
virtual

Reimplemented in AInteractableBox, and ATerminal.

49{
50}

◆ ReceiveOnEndInteract()

void AInteractableActor::ReceiveOnEndInteract ( AActor * Caller)
virtual
62{
63}

◆ ReceiveOnEndOverlap()

void AInteractableActor::ReceiveOnEndOverlap ( AActor * Caller)
virtual

Reimplemented in ATerminal.

70{
71}

◆ ReceiveOnInteract()

void AInteractableActor::ReceiveOnInteract ( AActor * Caller,
const EInteractionType InteractionType )
virtual

Reimplemented in AInteractableBox, AInteractableSwitch, AInteractionPingActor, AOpenableDoorActor, and ATerminal.

53{
55 if(BaseCaller != nullptr)
56 {
57 BaseCaller->InteractionDataUpdated();
58 }
59}
Definition InteractionInterface.h:18
virtual void InteractionDataUpdated() const
Definition InteractionInterface.h:57
static IInteractionInterface * GetInteractionFromComponent(const AActor *Actor)
Definition InteractionBPLib.cpp:10

◆ ReceiveOnOverlap()

void AInteractableActor::ReceiveOnOverlap ( AActor * Caller)
virtual

Reimplemented in AInteractionPingActor, and ATerminal.

66{
67}

◆ ReceiveStartFocus()

void AInteractableActor::ReceiveStartFocus ( AActor * Caller)
virtual

Reimplemented in AInteractableBox, and ATerminal.

45{
46}

◆ ReceiveToggleSwitch()

void AInteractableActor::ReceiveToggleSwitch ( AActor * Caller,
const bool bOn )
virtual

Reimplemented in AInteractableBox, AInteractableSwitch, and AOpenableDoorActor.

74{
75}

◆ SetMeshOutline()

void AInteractableActor::SetMeshOutline ( const bool bValue)
protectedvirtual
114{
115 if(RootComponent.Get() != nullptr)
116 {
117 UStaticMeshComponent* StaticMeshComponent = Cast<UStaticMeshComponent>(RootComponent.Get());
118 if(StaticMeshComponent != nullptr)
119 {
120 if(StaticMeshComponent != nullptr)
121 {
122 StaticMeshComponent->SetRenderCustomDepth(bValue);
123 }
124 }
125 USkeletalMeshComponent* SkeletalMeshComponent = Cast<USkeletalMeshComponent>(RootComponent.Get());
126 if(SkeletalMeshComponent != nullptr)
127 {
128 if(SkeletalMeshComponent != nullptr)
129 {
130 SkeletalMeshComponent->SetRenderCustomDepth(bValue);
131 }
132 }
133 }
134}

◆ Tick()

void AInteractableActor::Tick ( float DeltaTime)
overrideprotectedvirtual
108{
109 Super::Tick(DeltaTime);
110
111}

Member Data Documentation

◆ AudioReactionComponent

class UAudioReactionComponent* AInteractableActor::AudioReactionComponent
protected

◆ InteractableActorComponent

class UInteractableActorComponent* AInteractableActor::InteractableActorComponent
protected

◆ PerceptionStimuliComponent

class UAIPerceptionStimuliSourceComponent* AInteractableActor::PerceptionStimuliComponent
protected

The documentation for this class was generated from the following files: