interactables, game state

This commit is contained in:
Ji Yoon Rhee
2023-10-15 21:18:31 -04:00
parent 0abfca2e0c
commit 2fb7b538df
184 changed files with 196644 additions and 167614 deletions

View File

@ -3,3 +3,15 @@
#include "HYGameStateBase.h"
AHYGameStateBase::AHYGameStateBase()
{
static ConstructorHelpers::FObjectFinder<UDataTable> BP_ItemDataTable(
TEXT("DataTable'/Game/Data/ItemDataTable.ItemDataTable'"));
ItemDatabase = BP_ItemDataTable.Object;
}
UDataTable* AHYGameStateBase::GetItemDatabase() const
{
return ItemDatabase;
}

View File

@ -2,16 +2,26 @@
#pragma once
#include "CoreMinimal.h"
#include "Engine.h"
#include "GameFramework/GameStateBase.h"
#include "HYGameStateBase.generated.h"
/**
*
* The game state holds the database for all existing items within the game.
*/
UCLASS()
class HWANYOUNG2_API AHYGameStateBase : public AGameStateBase
{
GENERATED_BODY()
public:
AHYGameStateBase();
//getter function for item database
UDataTable* GetItemDatabase() const;
protected:
UPROPERTY(EditDefaultsOnly)
class UDataTable* ItemDatabase;
};

View File

@ -0,0 +1,27 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "HYInteractableActor.h"
// Sets default values
AHYInteractableActor::AHYInteractableActor()
{
// 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 AHYInteractableActor::BeginPlay()
{
Super::BeginPlay();
}
// Called every frame
void AHYInteractableActor::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}

View File

@ -0,0 +1,26 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "HYInteractableActor.generated.h"
UCLASS()
class HWANYOUNG2_API AHYInteractableActor : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AHYInteractableActor();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
};