Interactible.h 748 B

123456789101112131415161718192021222324252627282930
  1. // Fill out your copyright notice in the Description page of Project Settings.
  2. #pragma once
  3. #include "CoreMinimal.h"
  4. #include "Components/ActorComponent.h"
  5. #include "Interactible.generated.h"
  6. UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
  7. class RAAN_API UInteractible : public UActorComponent
  8. {
  9. GENERATED_BODY()
  10. /** type of damage */
  11. UPROPERTY(BlueprintReadWrite, Category="Interaction", meta = (AllowPrivateAccess = "true"))
  12. TSubclassOf<class UInteraction> Interaction;
  13. public:
  14. // Sets default values for this component's properties
  15. UInteractible();
  16. protected:
  17. // Called when the game starts
  18. virtual void BeginPlay() override;
  19. public:
  20. // Called when the player Interacts with this actor
  21. void Interact();
  22. };