Added Base Door Functionality

This commit is contained in:
MARCEL HARA 2023-11-20 14:31:19 +00:00
parent 0cf77cbcde
commit 59f813050d
2 changed files with 76 additions and 0 deletions

View 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();
}

View 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();
};