Add Interactable Actor Component

This commit is contained in:
Louis Hobbs 2023-05-29 01:35:18 +01:00
parent 8ffda269b7
commit a8adf8abfb
2 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,25 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "InteractableComponent.h"
// Sets default values for this component's properties
UInteractableComponent::UInteractableComponent()
{
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
// off to improve performance if you don't need them.
PrimaryComponentTick.bCanEverTick = false;
// ...
}
// Called when the game starts
void UInteractableComponent::BeginPlay()
{
Super::BeginPlay();
}
void UInteractableComponent::Interact()
{
}

View File

@ -0,0 +1,26 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "InteractableComponent.generated.h"
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class NAKATOMI_API UInteractableComponent : public UActorComponent
{
GENERATED_BODY()
public:
// Sets default values for this component's properties
UInteractableComponent();
protected:
// Called when the game starts
virtual void BeginPlay() override;
public:
UFUNCTION()
void Interact();
};