diff --git a/Source/Nakatomi/InteractableComponent.cpp b/Source/Nakatomi/InteractableComponent.cpp new file mode 100644 index 0000000..a0fc5f6 --- /dev/null +++ b/Source/Nakatomi/InteractableComponent.cpp @@ -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() +{ +} diff --git a/Source/Nakatomi/InteractableComponent.h b/Source/Nakatomi/InteractableComponent.h new file mode 100644 index 0000000..03939ff --- /dev/null +++ b/Source/Nakatomi/InteractableComponent.h @@ -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(); +};