From 59f813050d5353e2564f862a35162a041a265d87 Mon Sep 17 00:00:00 2001 From: MARCEL HARA Date: Mon, 20 Nov 2023 14:31:19 +0000 Subject: [PATCH] Added Base Door Functionality --- .../Source/EndlessVendetta/DoorClass.cpp | 40 +++++++++++++++++++ .../Source/EndlessVendetta/DoorClass.h | 36 +++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 EndlessVendetta/Source/EndlessVendetta/DoorClass.cpp create mode 100644 EndlessVendetta/Source/EndlessVendetta/DoorClass.h diff --git a/EndlessVendetta/Source/EndlessVendetta/DoorClass.cpp b/EndlessVendetta/Source/EndlessVendetta/DoorClass.cpp new file mode 100644 index 00000000..5f69bf2a --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/DoorClass.cpp @@ -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(); +} + + + diff --git a/EndlessVendetta/Source/EndlessVendetta/DoorClass.h b/EndlessVendetta/Source/EndlessVendetta/DoorClass.h new file mode 100644 index 00000000..8d321772 --- /dev/null +++ b/EndlessVendetta/Source/EndlessVendetta/DoorClass.h @@ -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(); + +};