-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDoorAccessable.cpp
More file actions
41 lines (28 loc) · 1015 Bytes
/
Copy pathDoorAccessable.cpp
File metadata and controls
41 lines (28 loc) · 1015 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "DoorAccessable.h"
#include "Engine.h"
// Sets default values
ADoorAccessable::ADoorAccessable(const class FObjectInitializer& PCIP)
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
RootComponent = PCIP.CreateDefaultSubobject<USceneComponent>(this, TEXT("HOLD"));
Door = PCIP.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("Door"));
Door->SetupAttachment(RootComponent);
doorFrame = PCIP.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("DoorFrame"));
doorFrame->SetupAttachment(Door);
}
// Called when the game starts or when spawned
void ADoorAccessable::BeginPlay()
{
Super::BeginPlay();
}
// Called every frame
void ADoorAccessable::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
void ADoorAccessable::ToggleOpen()
{
GEngine->AddOnScreenDebugMessage(0, 5.f, FColor::Emerald, "Door Destroyed");
Destroy(this);
}