Added Base Door Functionality
This commit is contained in:
parent
0cf77cbcde
commit
59f813050d
40
EndlessVendetta/Source/EndlessVendetta/DoorClass.cpp
Normal file
40
EndlessVendetta/Source/EndlessVendetta/DoorClass.cpp
Normal file
@ -0,0 +1,40 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "DoorClass.h"
|
||||
|
||||
// Sets default values
|
||||
ADoorClass::ADoorClass()
|
||||
{
|
||||
// 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;
|
||||
|
||||
}
|
||||
|
||||
// Called when the game starts or when spawned
|
||||
void ADoorClass::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
}
|
||||
|
||||
// Called every frame
|
||||
void ADoorClass::Tick(float DeltaTime)
|
||||
{
|
||||
Super::Tick(DeltaTime);
|
||||
|
||||
}
|
||||
|
||||
void ADoorClass::Interact()
|
||||
{
|
||||
if (!IsValid(this)) return;
|
||||
GLog->Log("Door has been interacted");
|
||||
}
|
||||
|
||||
void ADoorClass::InteractPrompt()
|
||||
{
|
||||
DoorPrompt();
|
||||
}
|
||||
|
||||
|
||||
|
36
EndlessVendetta/Source/EndlessVendetta/DoorClass.h
Normal file
36
EndlessVendetta/Source/EndlessVendetta/DoorClass.h
Normal file
@ -0,0 +1,36 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/Actor.h"
|
||||
#include "EndlessVendetta/InteractionInterface.h"
|
||||
#include "DoorClass.generated.h"
|
||||
|
||||
class AEndlessVendettaCharacter;
|
||||
|
||||
UCLASS()
|
||||
class ENDLESSVENDETTA_API ADoorClass : public AActor, public IInteractionInterface
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
// Sets default values for this actor's properties
|
||||
ADoorClass();
|
||||
|
||||
protected:
|
||||
// Called when the game starts or when spawned
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
public:
|
||||
// Called every frame
|
||||
virtual void Tick(float DeltaTime) override;
|
||||
|
||||
void Interact() override;
|
||||
|
||||
void InteractPrompt() override;
|
||||
|
||||
UFUNCTION(BlueprintImplementableEvent)
|
||||
void DoorPrompt();
|
||||
|
||||
};
|
Loading…
Reference in New Issue
Block a user