Files
Faye/Source/Faye/GameObjects/ShelfActor.cpp
2026-07-03 19:56:31 +02:00

44 lines
793 B
C++

// Fill out your copyright notice in the Description page of Project Settings.
#include "ShelfActor.h"
#include "Components/InteractionWidgetComponent.h"
#include "Faye/Components/ShelfComponent.h"
#include "Faye/Inventory/Inventory.h"
AShelfActor::AShelfActor()
{
PrimaryActorTick.bCanEverTick = true;
}
void AShelfActor::BeginPlay()
{
Inventory = NewObject<UInventory>(this);
Super::BeginPlay();
GenerateBookRow();
}
void AShelfActor::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
void AShelfActor::GenerateBookRow()
{
for (auto Component : GetComponents())
{
if (UShelfComponent* ShelfComponent = Cast<UShelfComponent>(Component))
{
ShelfComponent->GenerateBookRow();
}
}
}
UInventory* AShelfActor::GetInventory_Implementation() const
{
return Inventory;
}